07-04-2012 12:09 PM
Hi guys,
Been away for a while, but now I'm back in to the swing of Labview again! I'm trying to create a system which presents data in an x-y graph, but I want the graph to have the x- and y-axis passing through the centre, rather than meeting at a corner.
I read this thread, but I couldn't figure out how to customise the graph the way Jake H suggested. I also saw this thread, but the solution proposed doesn't really do what I want. If there's any confusion over what I need to achieve, the hurriedly-drawn sketch (attached) should clarify things.
Thanks in advance!
07-04-2012 12:31 PM
The big thing here is to right click on the graph and select X Scale then turn off Autoscale X. Do the same thing for Y Scale.
You can then double click on the low number of the scales and change the number to something negative (say -10). This will put the axes in the center and leave them there (since there is no auto-scaling).
Rob
07-04-2012 01:01 PM
Hi Rob, thank you for your attention. Unfortunately, this solution isn't helping, for two reasons:
1) Even with autoscaling off, and the graph set with the low numbers on each axis to a negative number, the axes do not move to the centre.
2) I will need to autoscale the x-axis, as the upper and lower limits (while usually equal) will vary depending on the data being plotted.
Is there something else I can try? Many thanks.
07-04-2012 01:47 PM - edited 07-04-2012 01:48 PM
Strange, because when I do it, this is what I get (looks like 0,0 is in the center to me):
And no auto-scaling.
If you want no grid lines, you may have to use a cursor set to (0,0) to put your axes in.
And you may have to set upper and lower limit programmatically if you want both sides equal and auto-scaling.
Rob
07-04-2012 02:01 PM
Ok, so as I showed in my original attachments, what I would like is the axes through the centre of the plot. As you can see from the other attachment in my previous post, I have successfully set up the graph with the point (0,0) in the centre, and the formatting is all as I would like it except that the axes lines should be visible where the cursor (red dased line) is. In other words, what I would like is to selectively place two gridlines, one along x = 0, and one along y = 0, but both with tickmarks. This can replace the axes at the sides.
07-04-2012 02:49 PM
@MattA1 wrote:
Ok, so as I showed in my original attachments, what I would like is the axes through the centre of the plot. As you can see from the other attachment in my previous post, I have successfully set up the graph with the point (0,0) in the centre, and the formatting is all as I would like it except that the axes lines should be visible where the cursor (red dased line) is. In other words, what I would like is to selectively place two gridlines, one along x = 0, and one along y = 0, but both with tickmarks. This can replace the axes at the sides.
You have successfuly setup up nothing. All I see is your attachment is a JPG file. Where is the VI where you have successfully set up the graph?
07-04-2012 03:48 PM
My apologies, I assumed that since the graph setup is purely a "cosmetic" aspect of the VI, an image of the way the graph is currently set up would be sufficient. I assure you the graph is set up, and if you look at the jpeg, it should be fairly clear that the settings are as I described in my previous post. I am currently out of office, so I cannot access the VI itself. What extra information do you require before you will be capable of helping?
07-04-2012 05:14 PM
I manage to get the 0,0 to be in the middle of the XYGraph.
I had to disable the autoscaling as Robert Cole suggested.
To start I input -10 and +10 as the minimum and maximum values.
You can change that with the Property Node.
Then I removed the uniform spacing for the markers for the axes.
I have attached a VI in 8.5 version. It isn't perfect, but hopefully you can customize it to what you want.
07-04-2012 05:35 PM
If you use an X-Y graph you can create "markers" where you want them by adding extra plots.
Is this something like what you have in mind?
Lynn
07-05-2012 04:41 AM
Thank you for this solution, nyc and Lynn. It's not quite exactly what I wanted but it's close enough for now.
I'm not sure exactly how you managed to keep the intermediate tick marks between the 0 point and the maxima of each axis though, Lynn. How did you set your x-axis marker?