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 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:
- Double click your graph to open the Graph Setup dialog.
- From the Style template menu at the bottom of the dialog, select the template you want.
- To see what the templates look like, click the Preview tab. When you select an option 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.
- If you want to modify any other settings beyond those in the template, you can do so now.
- 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:
- 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.
- 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.
- Click the Preview tab to see what all settings will look like.
- From the "Style Template" menu, select "New Template".
- Type in a name for the template.
- 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:
- Open the "Graph setup dialog by double clicking on a graph for variable V.
- If variable V does not already use template T, select T from the Style template menu.
- Modify any Graph settings you want for T.
- Check the effect in the Preview tab.
- 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:
- Select a new variable with no graph settings, or a graph whose settings you want to make the global default.
- Double click on the graph to open Graph setup dialog.
- If you want, make further changes to the settings, and review them in the Preview tab.
- From the Style template' menu, select Global Default, if it isn't already selected.
- Click Set default button.
Note: Changes to global defaults will change all existing and new graphs that use global defaults -- unless they are overridden by Graph settings or a template set for that graph .
To rename a Graph style template
- Open the Graph setup dialog, by double-click on a graph.
- In the Style template menu, select the Graph template you want to rename.
- Click the Style templatemenu to select the old name.
- Type in the new name.
- 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:
- Create a library module called, say,
- Open the Outline window by clicking on its icon in the tool bar.
- Find the template in the Outline window, and double click to open its Object Window.
- Copy its identifier <id> by double-clicking the identifier in the Object window, and pressing Ctrl+C.
- Open the Typescript window by pressing Ctrl+' .
Move <id> Template_library
<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:
- Double-click the
Template_libraryto open its Object Window (in Edit mode)
- Press the Class menu at top-left of the Object window to open it, and change selection to Filed library.
- 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
- Press Ctrl+' to open the Typescript window
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.
Introduced in Analytica 4.0.
Enable comment auto-refresher