| View previous topic :: View next topic |
| Author |
Message |
Mike
Joined: 05 May 2008 Posts: 123 Location: Christchurch, New Zealand
|
Posted: Mon Jul 26, 2010 8:20 pm Post subject: Multiple "two y axis" plots |
|
|
Hi David,
I have a figure containing two plots, via split axes, each showing position vs time. A reviewer has asked for another variable (velocity vs time) to be superimposed on each. i.e. I need two panels, each with two y axes.
I've looked at the template example for plotting two y axes on one graph by using the "Join Y" option. That works fine for a single chart. But is it possible to have two charts, each with two y axes? When I try that with the "Join Y" button, all the variables get drawn within a single plot frame. Is it possible to somehow specify which graphs to combine via "Join Y"?
Or will I need to draw each "double Y axis" chart in a separate DataGraph file, and then arrange them next to each other in a third?
Regards,
Michael |
|
| Back to top |
|
 |
David Site Admin
Joined: 25 Nov 2006 Posts: 1023 Location: Chapel Hill, NC
|
Posted: Tue Jul 27, 2010 8:33 am Post subject: |
|
|
In the original plot, are the x or y axis stacked?
If the x are stacked, i.e. side by side this should be automatic. If they are one of top of the other, this is not currently easy in a single DataGraph file. You can do it using an extra axis but it is somewhat of a workaround.
David |
|
| Back to top |
|
 |
Mike
Joined: 05 May 2008 Posts: 123 Location: Christchurch, New Zealand
|
Posted: Tue Jul 27, 2010 8:43 am Post subject: |
|
|
They are stacked: two graphs side by side.
But because of the way the data is plotted, what I actually want is a double x axis rather than double y (I just described it as double y because that's the normal terminology).
Does that make a difference? |
|
| Back to top |
|
 |
David Site Admin
Joined: 25 Nov 2006 Posts: 1023 Location: Chapel Hill, NC
|
Posted: Tue Jul 27, 2010 8:56 am Post subject: |
|
|
So you mean that you want a left and right graph, and on both graphs you have two x axes.
Right now you would have to use a similar trick as is used in this template. It is for the y axes.
David |
|
| Back to top |
|
 |
Mike
Joined: 05 May 2008 Posts: 123 Location: Christchurch, New Zealand
|
Posted: Tue Jul 27, 2010 9:13 am Post subject: |
|
|
| David wrote: | | So you mean that you want a left and right graph, and on both graphs you have two x axes. | Yes.
| Quote: | | Right now you would have to use a similar trick as is used in this template. | I missed that one. It seems to do what I want. Not sure I understand the trick though. Will work my way through it when I get a moment.
Thanks for the pointer. |
|
| Back to top |
|
 |
Mike
Joined: 05 May 2008 Posts: 123 Location: Christchurch, New Zealand
|
Posted: Mon Aug 09, 2010 6:31 am Post subject: |
|
|
Hi, finally got a chance to replicate the example. I can get multiple data series on each of the two plots, by making a scaled version of one variable so that it can be plotted on the range of the other.
The variables have quite different ranges (one ranges from -40deg to +20deg, the other from -500deg/s to +500deg/s), so I have to scale the second by about 0.06 in order to plot it on the same axis as the first. So that works OK. But my question is how do I get the axis at the other end to reflect the original data range?
I can't quite work this out from the example template. There is an option on the axis to "Convert units", with "data" specified as "c" and "Display" as "10". I'm not sure what either of those mean: the tooltips aren't clear to me, and the relevant diagram in the help seems to have different labels ("units" and "data units") so I'm not sure if it is doing the same thing? |
|
| Back to top |
|
 |
David Site Admin
Joined: 25 Nov 2006 Posts: 1023 Location: Chapel Hill, NC
|
Posted: Mon Aug 09, 2010 7:24 am Post subject: |
|
|
I changed the tool tip to the following:
| Quote: | | The ratio Data/Display is used to scale the drawing units (displayed in a standard axis) for the tick marks on this axis. E.g. if Data=m (1) and Display is cm (0.01) this ratio is 100. |
The fields understand a lot of constants. To see a list of them type in some gibberish, since the error message lists the constants that are understood.
The reason for the names was this type of unit conversion. If you go into the scratch window and type in 4cm/inches in the expression field, you get 4cm in inches (1.57). If the entry in the data column is in cm (Data) and you want your axis to be in inches (Display) cm/inch is the conversion constant you need. Hopefully the tool tip explains this better as well as supports this slightly tricky use of the extra axis command.
Normally this use is done with the "Join" option, but since you want a hybrid join/stack this workaround is needed for now. I will think more about a more native and quicker approach.
David |
|
| Back to top |
|
 |
Mike
Joined: 05 May 2008 Posts: 123 Location: Christchurch, New Zealand
|
Posted: Mon Aug 09, 2010 10:45 pm Post subject: |
|
|
I'm scaling completely different variables (position and velocity) so I can't use any of the inbuilt unit conversions. Is there a simple way to scale the tick marks on an axis to match an arbitrary conversion factor?
e.g. I scale my velocity values by 0.06 so that they can plotted on the same chart as the position values. But then I need tick marks on an axis which reflect the actual velocity values.
I've put "1" in the "data" box and "0.06" in the "display" box. That seems to produce axis tick marks which are approximately correct but it is hard to know if I'm doing the right thing... |
|
| Back to top |
|
 |
David Site Admin
Joined: 25 Nov 2006 Posts: 1023 Location: Chapel Hill, NC
|
Posted: Tue Aug 10, 2010 9:25 am Post subject: |
|
|
That should work. The ratio is all that matters, so 2 in both will not cause any changes.
The only restrictions for now is that it needs to be a scale. For a scale + shift, the only thing I support at this point is temperature conversion.
If it looks right, it should be exactly right. Either the scale is 1/0.06 or 0.06. Unless you are doing a conversion like 1/0.94 you should see it. You can use the context menu to see the coordinate (of the click). Or the loupe tool to see if the conversion looks about right.
David |
|
| Back to top |
|
 |
Mike
Joined: 05 May 2008 Posts: 123 Location: Christchurch, New Zealand
|
Posted: Tue Aug 10, 2010 6:14 pm Post subject: |
|
|
| Many thanks. |
|
| Back to top |
|
 |
|