Difference between revisions of "Graph templates"

 
(8 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
[[Category: Graphs]]
 
[[Category: Graphs]]
  
<breadcrumbs>Analytica User Guide > Formatting Numbers, Tables, and Graphs > {{PAGENAME}}</breadcrumbs>
+
<breadcrumbs>Analytica User Guide > Graphs > {{PAGENAME}}</breadcrumbs>
  
  
Line 10: Line 10:
 
To apply an existing graph template to a graph:
 
To apply an existing graph template to a graph:
  
# Double-click your graph to open the '''Graph setup '''dialog.
+
# 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.
 
# 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.
+
# To see what the templates look like, click the '''Preview '''tab. As you select each template from the [[Graph Style Templates|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.
 
# 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'''.
 
# 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 ==
 
== 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.
+
If you have a graph that uses a template '''T''', and you want to unlink it from the template, change the [[Graph Style Templates|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 define a new graph style template ==
 
To create a new graph template so you can reuse a collection of graph settings for other variables:
 
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.
+
# 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'''.
 
# 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.
 
# Click the '''Preview '''tab to see what all settings look like.
Line 34: Line 34:
 
To modify an existing graph style template '''T''':
 
To modify an existing graph style template '''T''':
  
# Open the '''Graph setup '''dialog by double-clicking a graph for variable '''V'''.
+
# 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.
+
# If variable '''V '''does not already use template '''T''', select '''T '''from the [[Graph Style Templates|Style template]] menu.
 
# Modify any '''Graph settings '''you want for '''T'''.
 
# Modify any '''Graph settings '''you want for '''T'''.
 
# Check the effect in the '''Preview '''tab.
 
# Check the effect in the '''Preview '''tab.
Line 45: Line 45:
 
You can apply graph settings, and most uncertainty settings, at three levels:
 
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.
+
'''Local''': Clicking '''Apply '''in the [[Graph setup dialog|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.
+
'''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.
+
'''Model defaults''': Clicking '''Set Default '''in the [[Graph setup dialog|Graph setup]] or [[Uncertainty Setup dialog]] changes the global defaults for the model for any settings you have modified in the dialog.
  
 
<tip title="Tip">If you change a global setting by clicking '''Set default''', that setting changes for all graphs that do not override it by a template or a local setting.</tip>
 
<tip title="Tip">If you change a global setting by clicking '''Set default''', that setting changes for all graphs that do not override it by a template or a local setting.</tip>
  
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.
+
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 ==
 
== Saving defaults as a template model ==
Line 59: Line 59:
  
 
# 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.
 
# 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.,<code>Template.ana</code>.
+
# Select '''Save as '''from the [[File menu]] to save the model under a new name, e.g.,<code>Template.ana</code>.
 
# Delete all the contents of the model that you won’t need for new models.
 
# 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.
+
# Select '''Exit '''from the [[File menu]] and save the model.
  
 
Whenever you want to start a new model using these defaults, double-click <code>Template.ana</code>, 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:
 
Whenever you want to start a new model using these defaults, double-click <code>Template.ana</code>, 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:
Line 70: Line 70:
  
 
== Graph templates and setting associations ==
 
== 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.
+
'''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.
 
'''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.
Line 76: Line 76:
 
'''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 <code>Earthquake_damage</code> is indexed on the horizontal axis by <code>Richter_scale</code>. You set <code>Richter_scale</code> to <code>Log scale</code>, and save into a template '''T'''. If you use template '''T '''for another variable '''Y '''also indexed by <code>Richter_scale</code>, it also displays <code>Richter_scale</code> on a log scale. But, if '''Y '''is not indexed by <code>Richter_scale</code>, the axis setting has no effect.
 
'''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 <code>Earthquake_damage</code> is indexed on the horizontal axis by <code>Richter_scale</code>. You set <code>Richter_scale</code> to <code>Log scale</code>, and save into a template '''T'''. If you use template '''T '''for another variable '''Y '''also indexed by <code>Richter_scale</code>, it also displays <code>Richter_scale</code> on a log scale. But, if '''Y '''is not indexed by <code>Richter_scale</code>, 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.
+
'''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 ==
 
== 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.
+
'''''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 [[Graph Style Templates|Style template]] menu says '''Global default''', it means that the graph uses the global defaults with no template.
  
 
To modify the global defaults:
 
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.
 
# 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.
+
# 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.
 
# 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.
 
# From the '''Style template '''menu, select '''Global Default''', if it isn’t already selected.
Line 92: Line 92:
  
 
== To rename a graph style template ==
 
== To rename a graph style template ==
# Open the '''Graph setup '''dialog, by double-clicking a graph.
+
# Open the [[Graph setup dialog]], by double-clicking a graph.
 
# In the '''Style template '''menu, select the graph template you want to rename.
 
# In the '''Style template '''menu, select the graph template you want to rename.
 
# Click the '''Style template '''menu to select the old name.
 
# Click the '''Style template '''menu to select the old name.
Line 105: Line 105:
 
* [[Graph settings]]
 
* [[Graph settings]]
 
* [[Graph view of a result]]
 
* [[Graph view of a result]]
* [[Formatting Numbers, Tables, and Graphs]]
+
* [[Graphs]]
 
* [[Customization of Graph Colors]]
 
* [[Customization of Graph Colors]]
 
* [[Graphing roles]]
 
* [[Graphing roles]]

Latest revision as of 17:16, 1 June 2016



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:

  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 are reflected in the settings in the other tabs.
  4. If you want to modify any other settings beyond what the template specifies, you can do so now.
  5. 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:

  1. 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.
  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 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 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:

  1. Open the Graph setup dialog by double-clicking 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.
Tip
Any changes you make to a template affect all variables that use it, except for any local settings that override them for a particular variable.

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.

Tip
If you change a global setting by clicking Set default, that setting changes for all graphs that do not override it by a template or a local setting.

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:

  1. 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.
  2. Select Save as from the File menu to save the model under a new name, e.g.,Template.ana.
  3. Delete all the contents of the model that you won’t need for new models.
  4. 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:

  1. In the Windows File Explorer, open the folder containing Template.ana.
  2. Right-click Template.ana, and select Properties.
  3. 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 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 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:

  1. Select a new variable with no graph settings, or a graph whose settings you want to make the global default.
  2. Double-click 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 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

  1. Open the Graph setup dialog, by double-clicking a graph.
  2. In the Style template menu, select the graph template you want to rename.
  3. Click the Style template menu 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.

See Also


Comments


You are not allowed to post comments.