A Graph template lets you apply a collection of graph settings and styles to several graphs, or even to all the graphs in a model. Analytica comes with several standard templates. You can also define your own graph templates to to set standard graphing styles for a model, project, or an 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. As you select each template from the Style template menu, it applies it to the selected graph. All template settings are reflected in the settings in the other tabs.
- If you want to modify any other settings beyond what the template specifies, you can do so now.
- When you are happy with 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 want to unlink it from the template, change the Style template menu back from T to Global Default. It asks “Do you want to retain these styles for this graph?” If you answer yes, it copies the template settings to be local for this variable, so it looks the same, but future changes to the template have no effect. If you answer no, it removes 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 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 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 be saved with the model. You can apply this template 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 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.
Combining local, template, and model default settings
You can apply graph settings, and most uncertainty settings, at three levels:
Local: Clicking Apply in the Graph setup or Uncertainty Setup dialog applies any settings you have modified in the dialog to the current variable. These settings override any global or template settings.
Graph template: By selecting a style template in the Graph setup dialog and clicking Apply, you apply the template settings to the current variable. The template overrides any global settings, but not local settings.
Model defaults: Clicking Set Default in the Graph setup or Uncertainty Setup dialog changes the global defaults for the model for any settings you have modified in the dialog.
The Uncertainty sample tab of the Uncertainty Setup dialog is an exception. Settings on that tab — e.g., Sample size — are always defaults that affect the entire model. They cannot be local and are not saved in a graph template.
Saving defaults as a template model
Analytica comes with a wide variety of standard defaults for graph settings, uncertainty options, preferences, diagram style, and more. If you want to save nonstandard default settings for these, perhaps also including graph templates and libraries so that you can use them for new models, the easiest method is to create a new template model:
- Find or build a model that has all the default settings you want, including any graph settings, uncertainty settings, preferences, diagram style, graph templates, and user-defined attributes. It could also contain any libraries that you want in all the new models.
- Select Save as from the File menu to save the model under a new name, e.g.,
- Delete all the contents of the model that you won’t need for new models.
- Select Exit from the File menu and save the model.
Whenever you want to start a new model using these defaults, double-click
Template.ana, and save the model under a new name. To protect your template model from you accidentally changing it by saving a new model over it with the same name:
- In the Windows File Explorer, open the folder containing
Template.ana, and select Properties.
- Check the Read-only attribute, and click OK.
Graph templates and setting associations
Chart type and uncertainty views: Graph settings from the Chart type tab are associated with particular uncertainty views. For example, if you set Line style to symbols only (instead of the default pixel per data point) for a Sample plot, that line style applies to any sample plot, but not to other uncertainty views Mid, Mean, Statistics, PDF, or CDF. Thus, you can set a different Style setting for each uncertainty view, except Mid, Mean, and Probability Bands, which share the same style.
Settings for discrete vs. continuous: Analytica maintains separate line-style settings for continuous and discrete (categorical) plots. So, pivoting a continuous dimension to the x-axis to replace what was a discrete dimension can change the plot from a bar graph to line graph, and uses the corresponding settings.
Axes and indexes: If the horizontal axis is an index (as it usually is), 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
Log scale, and save into a template T. If you use template T for another variable Y also indexed by
Richter_scale, it also displays
Richter_scale on a log scale. But, if Y is not indexed by
Richter_scale, the axis setting has no effect.
Uncertainty options and graph templates: A graph template also saves non-default settings made in the Uncertainty Setup dialog tabs: Statistics, Probability 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, however — e.g., to Sample size —set global defaults, which affect the entire model. They are not associated with particular variable, or saved in a graph template.
Changing the global default
Global defaults are 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 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 change all existing and new graphs that use those 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
- Open the Graph setup dialog, by double-clicking a graph.
- In the Style template menu, select the graph template you want to rename.
- Click the Style template menu 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.
- Graph Style Templates
- Graph setup dialog
- Graph settings
- Graph view of a result
- Customization of Graph Colors
- Graphing roles
Enable comment auto-refresher