You can reformat your graph’s axes, using the X-Y Axes page of the Formatting Currently Selected X-Y Plot dialog box.
To change a graph’s format:
• Click in the graph to select it.
• Double-click in the graph. Alternatively, choose Graph=:}X-Y Plot from the Format menu. You’ll see the dialog box for formatting X-Y plots.
• If necessary, click the X-Y Axes tab to display the X-Y Axes page, shown below.
• There is a complete group of settings for each axis. Change the appropriate settings.
• Click “OK” to accept your changes and close the dialog box. Mathcad redraws the graph with the new settings in effect. Alternatively, click “Apply” to see the graph redrawn without closing the dialog box. Click “Close” to close the dialog box.
The rest of this section describes the settings on the X-Y Axes page of the dialog box for formatting X-Y Plots. It then provides detailed discussions about options for setting axis limits and for adding horizontal and vertical reference lines to your graph.
Each axis has the following settings associated with it:
When this box is checked, the selected axis is logarithmic and the axis limits must be positive. The bottom-right-hand graph in Figure 20-16 on page 489 illustrates a graph with a logarithmic axis
When this box is checked, the tick marks on the selected axis are replaced by grid lines. The top-right-hand graph in Figure 20-16 on page 489 illustrates a graph that uses grid lines rather than tick marks.
When this box is checked, the tick marks on the selected axis are numbered
This controls axis limits that you don’t otherwise specify. When this box is checked, Mathcad rounds the axis limit to the next major tick mark. When unchecked, Mathcad sets the axis limit to the data limit. For a discussion of Autoscale and the other ways to set axis limits, see “Setting limits for axes” later in this section.
When this box is checked, you can add reference lines to your graph. For a discussion of Show Markers and another way to create horizontal and vertical reference lines, see “Adding horizontal and vertical lines” later in this section.
When this box is checked, Mathcad automatically selects the number of grid intervals created by tick marks or grid lines on the axes. When the box is unchecked, you choose the number of grid intervals by typing in the box labeled “No. of Grids”. Enter a number from 2 to 99. You can specify the number of grid intervals only when Log Scale is unchecked. Figure 20-21 on page 491 illustrates the effect of Auto Grid.
These buttons define the style in which the graph will show the axes. Boxed axes are crossed in the bottom left comer of the graph. Crossed axes are crossed in the center of the graph. If you select None, no axes will be displayed on the graph. Figure 20-22 on page 492 illustrates the use of crossed axes. If you choose Equal Scale, both axes will use the same limits.
See the section “Setting default formats” on page 479 to learn how to:
• Quickly restore the graph to its default format settings.
• Use a particular graph as a model for all future graphs.
Setting limits for axes
Mathcad provides the following ways to set limits for axes:
• Automatically, with Autoscale turned on.
• Automatically, with Autoscale turned off.
• Manually, by entering the limits directly on the graph.
By default, a plot you create in Mathcad is autoscaled. With Autoscale on, Mathcad automatically sets each axis limit to the first major tick mark beyond the end of the data. This will be a reasonably round number large enough to display every point being
graphed. With Autoscale off, Mathcad automatically sets the axis limits exactly at the data limits.
Figure 20-10 shows how turning Autoscale on and then off changes the way the graph looks
To turn Autoscale off and have the axis limits automatically coincide with the end of the data:
• Click on the graph to select it and then choose Graph-e X.Y Plot from the Format menu. Mathcad displays the dialog box for formatting X-Y graphs, shown on page 472. Click the X-Y Axes tab if the X-Y Axes page is not displayed. (You can also double-click on the axis itself to see a similar dialog box.)
• Click on Autoscale for the appropriate axis to remove the check and to toggle Autoscale off.
You may want to use axis limits other than those set by Mathcad. You can override Mathcad’s automatic limits by entering limits directly on the graph. To do so:
• Click the graph to select it. Mathcad displays four additional numbers, one by each axis limit. These numbers are enclosed within corner symbols, as illustrated in the selected plot in Figure 20-11.
• To set the axis limit on the horizontal axis, click on the number underneath the appropriate x-axis limit and type the number at which you want the axis to end. To set an axis limit for the vertical axis, do the same thing to the number to the left of the appropriate y-axis limit.
• Click outside the graph. Mathcad redraws it using the axis limits you specified. The corner symbols below the limits you changed will disappear. Figure 20-11 shows the effect of manually setting limits on a graph.
Adding horizontal and vertical lines
Mathcad places linearly or logarithmically spaced tick marks or grid lines on a graph. The spaces between these markings are relatively round numbers that span the range of values on each axis. There may, however, be occasions when you need to place a line somewhere other than where Mathcad would normally place a grid line
To add a horizontal or vertical line to a plot:
• Click in the plot to select it.
• Choose Graph-eX-Y Plot from the Format menu or double-click on the graph to bring up the dialog box for formatting X-V graphs.
• If necessary, click on the X-Y Axes tab to display the X-Y Axes page, as shown on page 472.
• For a vertical line, click on Show Markers in the X-axis column to add a check; for a horizontal line, click on Show Markers in the Y-axis column to add a check. Click “OK”. Mathcad shows two additional placeholders on each axis for which you have Show Markers checked.
• To add a vertical line, click on one of the placeholders under the x-axis and type in a value at which you want a line drawn. For a horizontal line, do the same thing in one of the placeholders under the y-axis
When you click outside the graph, Mathcad draws a dashed line at each number you specify. The number you type appears at the end of the line. To move the dashed line click on the number in the placeholder and change it. To delete the line, delete this number or click on Show Markers for the appropriate axis to uncheck it
By using the Show Markers function, you can add to each axis one or two dashed lines stretching across the plot. When you need to place more than two lines or you need more control over the appearance of a line, you can add lines by plotting a constant expression
• To create a horizontal line, place a range variable on the middle placeholder of the x-axis and the constant expression on the y-axis. Mathcad will plot a horizontal line across the plot at whatever value the constant value happens to be. The expression you place on the y-axis need not depend on the range variable you place on the xaxis.
• To create a vertical reference line, reverse the roles of the x- and y-axes. Place a range variable on the middle placeholder of the y-axis and the constant expression on the x-axis