Chapter 13: Creating Graphs

Go to the Next Chapter
Go to the Previous Chapter
Go to the Table of Contents for This Manual
Go to the Guides Master Index

Chapter 1 * Chapter 2 * Chapter 3 * Chapter 4 * Chapter 5 * Chapter 6 * Chapter 7 * Chapter 8 * Chapter 9 * Chapter 10 * Chapter 11 * Chapter 12 * Chapter 13 * Chapter 14 * Chapter 15 * Chapter 16 * Chapter 17 * Chapter 18 * Chapter 19


13.1 Using the GUI to Create and Control Graphs

If you want to review your material property curves, trace the time-history response of your system, or examine the relationship between any two items in your analysis, you can often do so most effectively using a graph. ANSYS graphs can be either 2-D (X-Y) or 3-D (X-Y-Z, where Z must always be TIME). Figure 13-1 illustrates some typical graphs.

Figure 13-1 Typical ANSYS graphs

The most convenient way to create and control graph displays is by using the functions available under Utility Menu>Plot and Utility Menu>PlotCtrls. Alternatively, you can use graphics action and control commands, as described in the following subsections.

13.2 Graph Display Actions

The commands listed below create graphs anywhere in the ANSYS program (including the BEGIN level):

To display linear material properties (those defined with the MP family of commands) as a function of temperature, use the following:

Command(s):

GUI:

Main Menu>Preprocessor>Loads>Other>Change Mat Props>Graph
Main Menu>Preprocessor>Material Props>Graph
Main Menu>Solution>Other>Change Mat Props>Graph
Utility Menu>Plot>Materials

To display nonlinear stress-strain or B-H curves (those defined with the TB family of commands), use one of the following:

Command(s):

GUI:

Main Menu>Preprocessor>Loads>Other>Change Mat Props>Data Tables>Graph
Main Menu>Preprocessor>Material Props>Data Tables>Graph
Main Menu>Solution>Other>Change Mat Props>Data Tables>Graph
Utility Menu>Plot>Data Tables

To display column vectors of array parameters, use one of the following:

Command(s):

GUI:

Utility Menu>Plot>Array Parameters

The commands listed below create graphs in POST1 only:

To display a stress item associated with a particular location and event versus loading number (for use in fatigue analyses), use one of the following:

Command(s):

GUI:

Main Menu>General Postproc>Fatigue>Plot Stresses

To calculate and graph path items versus path length, choose one of these methods:

Command(s):

GUI:

Main Menu>General Postproc>Path Operations>Plot Path Items
Main Menu>General Postproc>Plot Results>Path Items
Utility Menu>Plot>Results>Path Plot

To calculate and graph the membrane and membrane plus linearized stresses along a path, use one of these methods:

Command(s):

GUI:

Main Menu>General Postproc>Path Operations>Linearized Strs
Main Menu>General Postproc>Plot Results>Lineariz Strs

The PLVAR command (Main Menu>TimeHist Postpro>Graph Variables) graphs any predefined variable as a function of TIME (or, for harmonic response analyses, frequency) or some other variable that you define. This command is available in the time-history postprocessor, POST26. A similar PLVAROPT command (Main Menu>Design Opt>Graphs/Tables) is available in OPT, the design optimization processor.

Issue the /REPLOT command (Utility Menu>Plot>Replot) to re-execute the last display action command that was executed.

13.3 Changing the Specifications for Graph Displays

In addition to reading about the features listed below, also see Chapter 8 for general graphics specifications that apply to any type of display, including graphs.

13.3.1 Changing the Type, Style, and Color of Your Graph Display

You can alter the appearance of your graph display as follows:

Turning axis divisions (tick marks) on or off.
You can control this feature using the AXDV label on the /GROPT command (Utility Menu>PlotCtrls>Style>Graphs).

Turning axis scale numbers on or off.
The AXNM label on the /GROPT command controls whether or not your axis scale numbers appear.

Changing the size of axis scale numbers.
You can enlarge or reduce the axis scale numbers, using the AXNSC label (and the KEY field) on the /GROPT command.

Changing the number of significant digits used in axis scale numbers.
Axis values will, by default, display four significant digits before the decimal point, and three significant digits after the decimal point. You can change these values with the DIG1 and DIG2 labels on the /GROPT command.

Switching between log and linear scales.
By default, your graphs will use linear scales. You can switch to log scales on the X and Y axes, using the LOGX and LOGY labels on the /GROPT command. (X and Y axes can be switched independently of each other; Z is always linear.)

Establishing separate Y-axis scales for different curves.
If you want to graph two or more different items on one display, you might find that the numerical values of the different graphed items differ so significantly that no meaningful information can be obtained from some of the curves. An example would be a time-history graph of an applied force (with magnitude ~103) superimposed over a time-history graph of a resulting deflection (with magnitude ~10-1). The deflection curve would appear to be a straight line if plotted to the same scale as the applied force.

To solve this problem, use different Y-axis scales for each curve. You can activate such a feature with the /GRTYP command (Utility Menu>PlotCtrls> Style>Graphs). /GRTYP,2 displays up to three separate 2-D curves, while /GRTYP,3 displays up to six separate 3-D curves. You must also make sure that automatic Y-axis scaling is set to its default value of ON (/GROPT,ASCAL,ON) for this feature to work.

Uniform scaling of separate Y axes.
If you want to label separate Y-axes distinctly, but want all of them to use the same Y axis scale, you must turn automatic Y-axis scaling off (/GROPT,ASCAL,OFF).

Creating "data slice" graph curves (curves that have Z-direction "thickness"). Separately-scaled curves can be separated and given Z-direction thickness with the /GRTYP,3 command. (To see this effect, you must change your display's viewing angle and distance-for instance, via /VIEW,1,2,2,3 and /DIST,1,.88 (Utility Menu>PlotCtrls>Pan, Zoom, Rotate). The color-fill option must also be set on via the /GROPT,FILL,ON command.)

Setting line thickness for axes, grid lines or graph curve lines.
You can accentuate graph items by increasing their line thickness, using the AXIS, GRID, and CURVE labels in the /GTHK command (Utility Menu>Plot Ctrls> Style>Graphs).

Turning the grid on or off (in the XY plane).
You can add a grid to your graph displays, using the /GRID command (Utility Menu>Plot Ctrls>Style>Graphs). If you add a grid, it can be either a full grid (horizontal and vertical grid lines) or a partial grid (horizontal or vertical grid lines).

Producing a dashed tolerance curve about the displayed curve.
You might want to indicate a range of data spread, tolerance, or uncertainty on your graph curves. You can do so using the SPREAD command (Main Menu> TimeHist Postpro>Settings>Graph).

Color-filling areas under curves.
You can enhance the visual impact of your graph curves by using the FILL label on the /GROPT command to fill the areas under the curves with color.

Changing the color of curves (and color-filled areas under curves).
The CURVE label on the /COLOR command (Utility Menu>PlotCtrls>Style> Colors>color type) allows you to control the color of each curve in your graph.

Filling the areas under curves with grids.
If you have turned on the color-fill option and have also turned on the grid option, then you can cause the grid to appear in the color-filled areas under curves by issuing /GROPT,CGRID,ON.

Coloring the XY, XZ, and/or YZ grid planes.
The GRBAK label on the /COLOR command allows you to control the color of the XY, YZ, and ZX planes.

Coloring the window background.
The WBAK label on the /COLOR command enables you to control the background color of each window in your display.

13.3.2 Labeling Your Graph

Labeling the axes.
You can label the X and Y axes using either of the following:the /AXLAB command.

Command(s):

GUI:

Utility Menu>PlotCtrls>Style>Graphs

Labeling the curves.
For POST26 plotted-variable graphs, the labels applied to your curves are established when you choose one of the following:

Command(s):

GUI:

Main Menu>TimeHist Postpro>Define Variables
Main Menu>TimeHist Postpro>Elec&Mag>Circuit>Define Variables

For all other types of graphs, the curves will be labeled with the item or parameter names specified in the display action command. (However, array parameter (*VPLOT) curves will simply be labeled with a column number.)

Adding user-defined graphics and text.
You can add extra graphics and text to your displays using the annotation functions by choosing Utility Menu>PlotCtrls>Annotation. See Chapter 14 of this manual for additional details.

13.3.3 Defining X and Y Variables and Their Ranges

The following subsections detail how to define X and Y variables and their ranges.

13.3.3.1 Defining the X Variable

In POST26 plotted-variable graphs, by default, the program uses TIME (or, for harmonic response analyses, frequency) for the X variable. TIME does not always have to represent chronological time. In setting up a time-independent analysis, you can arbitrarily define TIME to be equal to the value of some other item of interest (such as input pressure). To define a different parameter (other than TIME) against which the Y variable is to be displayed, use the NSOL, ESOL, and XVAR commands or their GUI equivalents.

13.3.3.2 Defining the Part of the Complex Variable to Be Displayed

When plotting harmonic-response results in POST26, you need to decide what part of the complex variable (amplitude, phase angle, real part, or imaginary part) to display in your graph. Make your choice using the PLCPLX command (Main Menu>TimeHist Postpro>Settings>Graph).

13.3.3.3 Defining the Y Variable

The various graphics "action" commands define the Y variable. Sometimes, these commands refer to labels that have been defined in other commands. For instance, PLPATH uses labels defined in the PDEF, PVECT, PCALC, PDOT, and PCROSS commands. PLVAR also uses labels defined in the NSOL and ESOL commands. PLSECT, FSPLOT, and *VPLOT, on the other hand, identify the Y variable directly. (For the GUI equivalents to these commands, see their descriptions in the ANSYS Commands Reference.)

13.3.3.4 Setting the X Range

The /XRANGE command (Utility Menu>PlotCtrls>Style>Graph) enables you to graph only a portion of the full range of X-variable data. This command allows you to "zoom" in or out on a particular segment of your curve.

13.3.3.5 Defining the TIME (or, For Harmonic Response Analyses, Frequency) Range

The PLTIME command (Main Menu>TimeHist Postpro>Settings>Graph) enables you to establish a range of TIME for graph displays. ANSYS always displays TIME in the Z-axis direction. If XVAR=1, TIME is also displayed in the X-axis direction. PLTIME or its equivalent then also sets the abscissa scale range. (A range established by /XRANGE takes precedence over one defined by PLTIME.)

13.3.3.6 Setting the Y Range

By default, your graph will contain the full range of available Y-variable data. Use the /YRANGE command (Utility Menu>PlotCtrls>Style>Graphs) to define a smaller or larger range. The NUM argument allows you to selectively define different ranges for different curves (providing you have established separate Y-axis scales).


Go to the beginning of this chapter