Newbie: templates

No matter how many times I read the manual and forums, I still can't figure out this well for opening a template and apply the setting to the graph.
I hope some of you are/were OriginLab/ Kaleidagraph users.
The way it works for me is like this: I made a graph, modify it here and there and save it as template. That way, I can create template for each graph of IR, UV=VIS, NMR, I-V, etc etc). Open new data, plot, and then open plot=templatd-data.

However the present settings are confusing to me. How should I proceed ?
The closest thing Igor has to a template is a graph style macro. To read about this, execute:
DisplayHelpTopic "Graph Style Macros"

Thank you, but I tried that, but the topic covered there is only valid for one specific experiment. If I opened a new experiment and imported my data, there will be no graph macro. How do I make this macro universally available for any data that I work with ?
Btw, I tried the auxiliary procedure window, but I do not know how to work with it. I suppose I need to find the macro file created before, copy and paste it, but that is way too tough for beginners ..

Can anyone post a practical guide for doing this in Mac ? I am sure most of you are doing this to maintain consistency in your graphs.
After you create the style macro, go to the main Procedure window. If there are is no other code in the Procedure window (recreation macros, etc.) you can simply choose File->Save Procedure Copy. Then navigate to the Igor Pro User Files folder and save in Igor Procedures.

If there is other code in the main Procedure window, then you need to follow a more complicated process:

1) Create a new procedure window by selecting Windows->New->Procedure Window. In the dialog, give it a name that says what it does.

2) Find the style macro in the main Procedure window. Select all the code from Window through End, then Edit->Cut.

3) Select Windows->Procedure Windows->
4) Paste the code into the new procedure window.

5) File->Save Procedure As, navigate to Igor Pro User Files folder, save in Igor Procedures folder.


You're right- this is too complicated. We keep thinking about how to make this easier while keeping the flexibility of the window macros.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
To learn about creating global procedure files (procedure files accessible all the time), execute this:
DisplayHelpTopic "Global Procedure Files"


Better yet, back up and read about procedure files in general so you understand how global procedure files fit into the picture:
DisplayHelpTopic "Procedure Windows"

Hello!

Has something changed about this?
I followed the instructions given here and in

DisplayHelpTopic"Graph Style Macros"


but in my case nothing was listed in the command window (I'm assuming that is the main procedure window).

It only says:

DoWindows/R/S=SmallPanel Graph0


"SmallPanel" of course being the style name that I assigned. I would really like to copy that style over to
another Igor experiment and not having to do it every time again.

Cheers,

Markus
MarkusG wrote:
but in my case nothing was listed in the command window (I'm assuming that is the main procedure window).

It only says:

DoWindows/R/S=SmallPanel Graph0


No, the command window has the command line below the red line for typing in individual commands, and the history area above the red line that shows commands that have been executed, along with output from commands.

The Procedure window is a special window for code- that is, macros and functions that have names and bodies with multiple command lines and control structures. Go to the Windows menu and select Procedure Windows->Procedure Window.

"THE Procedure Window" is the main procedure window. You can have more than one window with code in it, each one is a procedure window. The main Procedure window is always associated with an experiment file, never with a separate procedure file. Other procedure windows can be associated with files external to whatever experiment file you may be working with.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com

Hi,

I am also (more or less) a newbie here. Is there a way to modify existing graphs with a style macro? If I read the instruction well, it's only possible to apply the style macro when making a new graph.

Thanks a lot!

Mai

 

Hi,

I am also (more or less) a newbie here. Is there a way to modify existing graphs with a style macro? If I read the instruction well, it's only possible to apply the style macro when making a new graph.

Thanks a lot!

Mai

 

Make sure the graph you want to modify is the top graph window. Then select Windows->Graph Macros-><your style macro>

You can also simply invoke the style macro from Igor's command line, like any other macro or user-defined function.

One caveat is that a style macro does not include commands for modifying graph properties that have the default value. Thus, for example, if you create a style macro from a graph with a single trace default trace color, the style macro will not include a command to set the trace color. If you then apply the style macro to another graph with a single trace with a non-default trace color, its trace color will remain unchanged.

To provide a concrete example:

Make jack=sin(x/8)
Display jack  // Has default trace color (red)
DoWindow/R/S=Graph0Style Graph0  // Create style macro

If you now look at the Graph0Style proc in the procedure window, you will see no command to set the trace color:

Proc Graph0Style() : GraphStyle
    PauseUpdate; Silent 1       // modifying window...
EndMacro

Thus, if you apply this to a graph with, for example, a single blue trace, the trace's color will remain blue, not change to red.

This is why the help topic "Graph Style Macros" says:

Quote:
The purpose of a graph style macro is to allow you to create a number of graphs with the same stylistic properties. Igor can automatically generate a style macro from a prototype graph. You can manually tweak the macro if necessary. Later, you can apply the style macro to a new graph.

Consequently you may want to start with a style macro and then tweak it. Execute this for background information on style macro syntax:

DisplayHelpTopic "Graph Style Macros"