Graph Style Templates


A Graph Style Template is a collection of graph settings that you can apply to any graph. The settings may include chart type, axis range, style, colors, fonts, and background. Analytica 4.0 comes with some standard graph templates. You can also create your own graph templates, to define consistent styles for a model, a project, or even for your entire organization.

To use a Graph Style Template

To apply an existing graph template to a graph:

  1. Double click your graph to open the Graph Setup dialog.
  2. From the Style template menu at the bottom of the dialog, select the template you want.
  3. To see what the templates look like, click the Preview tab. As you select each template from the Style template menu, it applies it to the selected graph. All template settings will be reflected in the settings in the other tabs.
  4. If you want to modify any other settings beyond what the template, you can do so now.
  5. When you are happy with the the results (check them in the Preview tab), click "Apply" -- or if you don't like any of them, click "Cancel".

To stop using a Graph Style Template

If you have a graph that uses a template T, and you wish to unlink it from the template, change the "Style Template" menu back from T to "Global Default". It asks "Would you like to keep the styles from the template with this graph?" If you answer yes, it will copy the template settings to be local for this variable, so it looks the same, but future changes to the template will have no effect. If you answer no, it will remove the template settings from this graph so it reverts to the global defaults.

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 if you want to save only new settings, open it for a new variable.
  2. If you want to modify or add any settings, make those changes. You can also make a new template with changes to an existing template: In that case, select the existing template and click Apply template.
  3. Click the Preview tab to see what all settings will look like.
  4. From the "Style Template" menu, select "New Template".
  5. Type in a name for the template.
  6. Click the "Set Template" button.

You have now created a new template, which will saved it with the model. You may apply it to any graph in the model.

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 any local settings that override them for a particular variable.

Combining global, template, and individual graph style settings

You can set graph style (and most uncertainty settings) at three levels:

Global: By clicking Set Default in the Graph setup or Uncertainty Setup dialog, you change the global defaults for the model.

Template: By selecting a Style template in Graph setup, and clicking Apply, you apply the template settings to the current variable. They override any Global settings.

Local: By clicking Apply in the Graph setup or Uncertainty Setup dialog, you change the settings just for the current variable. These override any global or template settings.

Note that a template does not save global settings: If you change a global setting by clicking Set default', that change will affect all graphs that do not override them by a template or a local setting.

Graph templates and setting associations

Chart type settings: Graph settings from the Chart type tab are associated with a particular uncertainty view. For example, if you set Linestyle to symbols only for a Sample plot, that line style will apply to any Sample plot, but not for Mid, Mean, Statistics, PDF, or CDF. Thus, you may set a different Style settings for each uncertainty view -- except Mid, Mean, and Statistics, which share the same Style.

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. But, if Y is not indexed by Richter_scale, this Axis setting will have no effect.

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. These settings 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, and affect 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 Graph settings specifically set for that graph or by a template that it uses.

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 its Title attribute -- not its identifier. So, renaming a template does not affect any variables that use it.

To save Graph Style Templates into a Library module

Advanced users may save one or more Graph style Templates into a library module, so that you can reuse them in other models. Graph style templates are usually saved inside your model at the top level. They do not appear in Diagrams, but you can see them in the Outline view. Here is how you can move templates into a library module:

  1. Create a library module called, say, Template_library.
  2. Open the Outline window by clicking on its icon in the tool bar.
  3. Find the template in the Outline window, and double click to open its Object Window.
  4. Copy its identifier <id> by double-clicking the identifier in the Object window, and pressing Ctrl+C.
  5. Open the Typescript window by pressing Ctrl+' .
  6. Type Move <id> Template_library
    where <id> is the identifier you paste with Ctrl+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

Advanced users can delete a template, following the approach above to find its identifier <id>. Then

  1. Press Ctrl+' to open the Typescript window
  2. Type Delete <id> into the typescript, where <id> is the identifier of the template.

When you delete a template, it removes links from any graphs to that template. Any settings on graphs that used the template revert to the Global defaults.

History

Introduced in Analytica 4.0.

See Also

Comments


You are not allowed to post comments.