Graph Style Templates

Revision as of 23:03, 25 February 2007 by Max (talk | contribs) (Complete rewrite)

What's new in Analytica 4.0? >

A Graph Style Template is a collection of graph settings that you can apply to any graph. It lets you apply a combination of settings together -- say style, colors, fonts, and background -- defining a particular style you like. Analytica offers some existing graph templates, and more will be available in libraries. You can also create your own graph templates, saving a combination of settings you find useful -- perhaps, to define a common style for a model, or even for your entire organization.

To use a Graph Style Template

To apply an existing graph template to a graph:

  1. Open the Graph Setup dialog by double-clicking on the graph.
  2. From the Style template menu at the bottom of the dialog, select the template you want. (If you don't see it, you may first need to read in a library containing the template you want.)
  3. To visualize available templates, click the Preview tab. As you select each template from the Style template menu, it will immediately show what it looks like for the selected graph. All settings from the template, will be immediately reflected on the other tab.
  4. If you want to modify any other settings for this graph, you can do so now.
  5. When you are happy with the template and any other modifed settings (check them in the Preview tab), click "Apply".

To define a new Graph Style Template

To create a new Graph Template so you can reuse a collection of graph settings for other variables:

  1. Open the Graph Setup dialog by double-clicking on the graph with the settings you want to reuse, or on a new variable if you want to use only new settings.
  2. If you want to modify or add any other graph settings, do that now. If you want to make a new template, as modifications to an existing template, you could select the existing template and click Apply template.
  3. Click the Preview tab to see what the template settings will look like.
  4. From the "Style Template" pulldown menu, select "New Template".
  5. Enter a name for the template.
  6. Click the "Set Template" button.

This click creates the new template, and will saved it with the model. You may now apply it to any graph in the model.

Graph templates and setting associations

Chart type settings: Graph settings from the Chart type tab are associated with a particular view. For example, if you set Linestyle to symbols only for a Sample plot, it will use that line style for any Sample plot, but not for other uncertainty views, such as Mid, Statistics, PDF, or CDF. A template may contain different Style settings for each view.

Axes: If the horizontal axis is an index (the usual case), any settings on the Axes Ranges tab, apply to that index only. For example, suppose variable Earthquake_damage is indexed on the horizontal axis by Richter_scale. You set Richter_scale to Log scale, and save into a template T. If you use template T for another variable Y, also indexed by Richter_scale, it will also display Richter_scale on a log scale. If Y is not indexed by Richter_scale, this setting will have no effect on it.

Uncertainty options and graph templates: A Graph template will also save non-default settings made in the Uncertainty setup dialog tabs -- Statistics, Confidence bands, Probability density, or Cumulative probability. Such settings will apply to the corresponding uncertainty view of any variable using the template. Changes to the Uncertainty sample tab -- e.g. to Sample size -- are global, affecting the entire model: They are not associated with particular variable, or saved in a graph template.

For more see Graph_Setting_Associations

Changing the Global Default

"Global Default" specifies the default settings used by every graph unless overridden in the Graph setup dialog for that graph or by a template that it uses. If the Style Template menu says Global default, it means that the graph uses the global defaults with no template.

To modify the global defaults:

  1. Select a new variable with no graph settings, or a graph whose settings you want to make the global default.
  2. Double click on the graph to open Graph setup dialog.
  3. If you want, make further changes to the settings, and review them in the Preview tab.
  4. From the "Style template menu, select "Global Default", if it isn't already selected.
  5. Click "Set default" button.

Note:Changes to global defaults will change all existing and new graphs that use those global defaults -- that is, all that are not overridden by any nondefault Graph settings specifically set for that graph or the template that it uses.


To modify a Graph Style Template

To modify an existing Graph Style Template T:

  1. Open the "Graph setup dialog by double clicking on a graph for variable V.
  2. If variable V does not already use template T, select T from the Style template menu.
  3. Modify any Graph settings you want for T.
  4. Check the effect in the Preview tab.
  5. When satisfied, click Set template.

Note: Any changes you make to a template will affect all variables that use it -- except for variables that override the template settings.

To rename a Graph style template

  1. Open the Graph setup dialog, by double-click on a graph.
  2. In the Style template menu, select the Graph template you want to rename.
  3. Click the Style templatemenu to select the old name.
  4. Type in the new name.
  5. Click Set template.

Note: The template "name" is actually the Title of the object. Changing the name does not change the Template's identifier. Renaming a template does not affect any variables that use it.

Saving Graph Style Templates into a Library module

A Graph style template is a class of object in Analytica, usually saved inside your model at the top level. Analytica does not show Graph templates in a Diagram, but it does list them in the Outline view.

If you want to collect templates into a module or library for reuse by other models, you may want to move them from the main model into a library module Template_library:

  1. Open the Outline window by clicking on its icon.
  2. Find the template in the Outline window, a double click to open its Object Window.
  3. Copy the identifier of the template by double-clicking the identifier in the Object window, and pressing control-C.
  4. Open the typescript window by control-'
  5. Type "Move <Template-ID> Template_library\\\

where you <Template-ID> is the identifier you paste with control-V. Move command

Repeat for any other templates you want to include. When complete, you can save the Template_library as a separate library file in the usual way:

  1. Double-click the Template_library to open its Object Window (in Edit mode)
  2. Press the Class menu at top-left of the Object window to open it, and change selection to Filed library.
  3. Answer the prompts for the new file name and folder location, and click Save.

To delete a Style Template

As described for Moving a template, open an Object window for the template, copy its identifier, and open the typescript view. Then

  1. Type "Delete <template-id>" into the typescript, where <template-id> is the identifier of the template that you paste or type.

When you delete a template, it will remove links from any graphs to that template. Any settings on those graphs made by the template will revert to the Global defaults.

To Stop using a template

If you have a graph that uses a template, and you wish to unlink it from the template, change the "Style Template" pulldown back to "Global Default". A question is asked: "Do you want to transfer the settings from Template XXX to this variable's graph setup?". Answering no will dump all settings that come from the template. Answering Yes will leave these settings in place.

Comments


You are not allowed to post comments.