The Plot Macros panel allows you to create macros that produce curves and notes for plots. A plot macro can include either a curve or note, or both a note and a curve.
Plot macros can be used to capture and replay frequently used curve operations such as adding two curves together, filtering curves, or filtering and then curve fitting data. They can also be used for frequently used plot notes. Plot macros can be created and edited in the program or loaded automatically by registering them in a preference file.
When plot macros are added using the Plot Macros panel, they are saved in the session file. When plot macros are added in the preference file, they cannot be edited in the Plot Macros panel and are not saved to the session file.
Plot Macros panel
All plot macros in the current session are listed in the Macro list. Macros can be cut, copied, and pasted using the macro list.
The parameters associated with the selected macro are displayed in the Parameters list. Parameters can be either curve or scalar. Curve parameters are displayed as collectors. Click on a collector to graphically select a curve from a plot. Double-click on a collector to display the Select Curve dialog. Scalar parameters are displayed as text boxes. Parameters are usually used to collect curves from within the session to use in mathematical expressions. The result calculation can utilize any math functions, including Templex functions and external functions.
|
The Edit Plot Macros dialog allows you to add new plot macros to a session and edit the curves and notes for existing plot macros. This dialog is displayed when you select Add or Edit from the Plot Macros panel.
The Edit Plot Macro dialog tabs include:
Option
|
Description
|
Parameters
|
Add parameters for plots and notes.
|
Curve
|
Add or edit a plot macro curve.
|
Note
|
Add or edit a plot macro note. Notes can be attached to windows, views, existing curves, coordinates, and curves created by the macro.
|
|
Under Layout, you can control the placement of the resulting curves with the following options:
Option
|
Description
|
Place new curves in original plots
|
Inserts the resultant curve(s) in original plots. The created curves are associated to the original curve's axis.
|
Hide input curves
|
Original curve(s) are hidden but not deleted.
From the Edit Plot Macro dialog, select the option Hide input curves by default to set the default state of the Hide input curves check box when you select a macro from the Macro list.
|
Create new pages
|
Places resultant curve(s) on a new page. When creating curves from the Plot Macros panel, the created curves are associated to the same axis as the selected curves.
|
Use current plot
|
Places all resultant curve(s) in current plot.
|
|
Click Apply to apply a plot macro. The plot macro uses the parameters to create curves and notes within the session.
Undo reverses the plot macro.
How do I...
1. | From the Plot Macros panel, click Add. |
The Edit Plot Macro dialog is displayed.
2. | Click the Parameters tab. |
4. | Enter a parameter name in the Parameter text box. |
5. | Enter a variable name for the parameter in the Varname text box. |
6. | For Type, select Curve or Scalar. |
7. | Click on the Curve tab. |
8. | Double-click on a parameter in the Parameters list. |
The variable name for the parameter is displayed in the Label text box.
9. | For complex macros, activate the format for the data returned from the Y math expression by clicking on the Real/Imaginary or Phase/Magnitude radio buttons. |
10. | Enter math expressions for the X and Y coordinates. |
11. | For parameters of type "curve", curve vectors can be referenced in the math expression. When referencing vectors from linear curves, use parameter_name.x and parameter_name.y for x and y vectors, respectively. |
12. | When referencing vectors from complex curves, use the following naming conventions: |
Vector Type
|
Naming Convention
|
X
|
parameter_name.x
|
Y
|
parameter_name.y
|
Y phase
|
parameter_name.yp
|
Y magnitude
|
parameter_name.ym
|
Y real
|
parameter_name.yr
|
Y imaginary
|
parameter_name.yi
|
14. | Enter the macro name in the Macro text box. |
15. | If desired, rename the macro by highlighting the name from the list, entering a new name in the Macro field, and pressing enter. |
|
1. | From the Plot Macros panel, click Add. |
The Edit Plot Macros dialog is displayed.
3. | Activate the Create curve check box. |
4. | Enter a label for the curve in the Label text box. |
5. | Enter X and Y coordinates. |
If you are plotting complex data, specify the Y expression in Real/Imaginary or Phase/Magnitude.
|
1. | From the Plot Macros panel, select a macro from the macro list. |
4. | Activate the Create note check box. |
5. | Enter text in the Text box. |
6. | Select Window, View, Existing curve, Coordinate, or Curve created by this macro from the Attach To combo box. |
7. | Enter the data pertaining to the following: |
Existing curve
|
Curve and Point to which the note is attached.
|
Coordinate
|
X and Y coordinates to which the note is attached.
|
Curve created by this macro
|
Point to which the note is attached.
|
8. | Enter X and Y coordinates to position the note center. |
If you are plotting complex data, select Real/Imaginary or Phase/Magnitude for the Y coordinate.
You can use the functions from the Functions list.
|
1. | From the Plot Macros panel, click Add. |
The Edit Plot Macros dialog is displayed.
2. | Click the Parameters tab. |
4. | Enter a name in the Parameter text box. |
5. | Press ENTER or click in another box. |
The new parameter name is displayed in the list.
6. | Enter a variable name in the Varname text box. |
7. | Select Scalar or Curve from the combo box. |
The new parameter is listed in the Parameters list on the Plot Macros panel.
Note | Select the option Hide input curves by default to set the default state of the Hide input curves check box on the Plot Macros panel when you select a macro from the Macro list. |
|
1. | From the Plot Macros panel, select a macro from the list. |
The Edit Plot Macro dialog is displayed.
3. | Click the Parameters tab. |
4. | Add parameter names or edit existing names in the Parameters text box. |
5. | Select parameter types from the Type combo box. |
6. | Add or edit parameter variable names in the Varname text box. |
9. | Edit X and Y coordinates. |
11. | Edit the macro name in the Macro text box. |
12. | If desired, rename the macro by highlighting the name from the list, entering a new name in the Macro field, and pressing ENTER. |
|
1. | From the Plot Macros panel, select a macro from the list. |
2. | Type in scalar parameter values or select curves using the collectors. |
3. | Select a curve by pressing SHIFT and picking a curve from the screen or select a curve from the tree. |
4. | Select a method for placing the new curves from the Layout section. |
6. | Click Undo to remove the macro. |
|
1. | From the Plot Macros panel, select a macro from the macro list. |
3. | Move to the page that you want to paste the macro to. |
A copy of the macro with a similar name is added to the current macro list.
|
See Also:
Vehicle Safety Tools
Referencing Curves