Navigation:  How do I ...? > Example plots >

EX04.GRF

Print this Topic Previous pageReturn to chapter overviewNext page

Often you will run into a situation where you want to plot two curves on the same plot whose amplitudes are in different units. For example rainfall and corresponding flow rates in local tributaries, or velocity and acceleration, or in the case of this example, pressure and impulse. In such cases it is often useful to be able to associate these curves with different Y scales.

Open a new document window (File>New>XY Plot), then drag your mouse over the values below, right-click and select Copy, then Edit>Paste into DPlot.

0.767

0

0.767

1002

0.8028

837

0.8385

698.6

0.8743

582.9

0.91

486.1

0.9457

405.2

0.9993

308

1.053

233.9

1.124

161.7

1.196

111.5

1.285

69.83

1.41

35.94

1.571

15.03

1.839

3.289

2.554

0

This gives a pressure vs. time waveform. Generate an impulse curve (area under the pressure curve) by clicking the Integrate button (or selecting Generate>Integrate a Curve).

Integrate button

Youll notice that the amplitudes of the two curves are quite different. In this example this isnt critical, but in a plot with many more points and more detail wed needlessly be giving up resolution. And besides, since the two curves have different units we cannot easily create a Y axis label that is meaningful. The solution is to associate the impulse curve with a different Y scale. Select Options>Multiple Axes. Under Y Axis Options choose Independent Y2. This will cause a list of curves to be displayed. Youll notice that the first curve is not included in the list. This is because the first curve in a plot must always be associated with the primary Y axis. Select “2: Curve #2” in the list, then Y2 in the axis box:

Now, how to distinguish between the two curves? In other words, which curve is Pressure and which is Impulse? In the case of this example the answer might be obvious to most, but in other cases a visual cue would be very helpful. There are at least 3 ways to accomplish this:

1) With a legend. Select Text>Legend/Labels and enter the text you want as a descriptor for curve 1, then click the up arrow next to “Curve No.” and repeat for curve 2.

2) With point labels. Select Text>Label Points, then add labels at the points of your choosing that describe each curve, as shown here:

3) With axis labels drawn in the same color as the corresponding curves. This method is obviously of limited usefulness if you have more than 2 curves and want more than 2 colors. In the example, the pressure curve is drawn in red and the impulse curve is drawn in blue. You can control the color of both axis labels with the Fonts command, but we want unique colors for each axis label. You can embed color codes into the text itself on the Titles/Axes dialog (as well as most other inputs for text entries). To change the color of all or a portion of a text entry, highlight the text that you want to change the color of and click the Color button:

 

 


Page url: https://www.dplot.com/help/index.htm?ex04_grf.htm