LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple plot

Hello,
I'm a new user of LabWindows\CVI and I'm still familiarizing with it.

I've just a simple question about using PlotY in a GRAPH area.

I need to plot in a GRAPH area UP to 4 PlotY which shares the
same X scale but have different Y scales (so I could not overlap them).

I'd like the same capability of Digital Graph that permits adding new
diagrams allocating an indipendent horizontal strip. The strip
width decreases as new plots are added.

At the moment I provided 4 GRAPH areas where I put 4 different diagrams,
I wonder if a better solution is available.

Thanks.
0 Kudos
Message 1 of 6
(4,291 Views)
The Graph control can display only two Y scales: one to the left of the plot area and the second to the right of it. The default is to have the right scale not visible: to activate it open the graph control properties in the UIR editor by double-clicking on the graph, next click the "Right Y-axis-..." button and check the "Show labels" check box on the property panel that appear.

When I need to display more than two scales on a graph, I usually use more graphs superimposed one to each other so as to display only the scales on all graphs except one that will actually display all plots. Take a look at the sample panel attached: it is used to display full characteristics of an electric motor on one diagram only (voltage, speed and torque vs. current together with power and efficiency vs. current). I'm actually using up to three graph controls to display all those diagrams.

The trick here is to scale the plots with proper ratio so that are drawn on the diagram (that uses one Y scale) but conform with the scale of another diagram (used only to display the scale with different range): you must multiply the Y array by the ratio of the two scales to accomodate the plotting. In the sample panel, torque and power are plotted as they are, while for example speed it plotted after multiplying it by the ratio (full-scale torque / full-scale speed).


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 6
(4,284 Views)
Roberto,
thanks for your suggestions.
I have the constraints to create diagrams like the scheme below,
with a variable number of traces (from 1 to 4).

But I can adapt your solution creating many transparent diagrams
using only their Y scales (Ya, Yb,...) and a visible diagram that
overlaps all the other and shows only X scale. In this diagram I
will plot all my traces. Of course I need to scale them and, in
my case, to bias them too.

Is not as easy as I was expecting but it appears as the sole solution.
Ciao.



+-----------------------+
|.......................|
Ya +.....Diagram A........+
|.......................|
+-----------------------+
|.......................|
Yb +.....Diagram B........+
|.......................|
+-----------------------+
|.......................|
Yc +.....Diagram C........+
|.......................|
+---+---+---+---+---+---+
X common scale

Message Edited by fux on 05-10-2005 03:44 AM

0 Kudos
Message 3 of 6
(4,281 Views)
Fux,
maybe there is a simpler solution.

Use three graphs, one of them with visible X-axis and two with X-axis labels hided.
Set scale and divisions for X-axis the same on all of the graphs and adjust Y-axis accordingly to the signal to show for each one of them.

Look at the sample attached.

Message Edited by Roberto Bozzolo on 05-10-2005 09:54 PM



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 6
(4,256 Views)
Thank Roberto,

that was my first solution. But there are two problems:

1) The number of diagrams I have to display is variable [1..4].
OK, my solution is: prepare 4 panels, the first with one big
GRAPH area, the second with 2 and so on.

2) Y scale digits. Unfortunately the number of digits modifies the
dimension of the diagram. If a diagram has a Y scale 1..10 and
the second diagram 1..10000, the second will be more narrow,
then they will not be alligned on the X scale, this is not
accetable.
I can try forcing the Y scale to a fixing precision and set the
Engineering format to assure a wide range of representation, but
the result isn't very attractive.
Your first solution avoids this problem putting all traces in
the same diagram assuring the correctness of X scale.

I understand my problem is very specific but I'm just looking for
the best result among the possible solutions.


Ciao.
0 Kudos
Message 5 of 6
(4,239 Views)
Hi Fux,

can you use the right Y-axis of the diagrams? This can simplify you application in that only 2 different panels are visble: one wit one graph (for 1 or 2 plots) and one with 2 graphs (for 3 or 4 plots).

For scale size, you could effectively use for each diagram a graph without scales for plotting and a grahp with visible scales and plotting area transparent for scales: properly sizing the two graphs you can maintain stable plotting area size in all conditions.

My first solution is traditional in that context, plotting the characteristics of a motor. Customers and technicians are accustomed to this representation and they do expect to see it this way. In your case, you could ask yourself if there is a consolidated way of representing the phenmenon you are studying: respecting this "tradition" you can make your application more user friendly and more famliar to your customer. This can worth some effort in designing the best user interface.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 6
(4,219 Views)