LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

4-quadrant plot (graph with axes passing through centre)

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!

---------------------------------------------------------------------
LabVIEW 2013, Windows 7

He who asks the question is a fool for five minutes; he who does not ask the question remains a fool forever.
0 Kudos
Message 1 of 12
(4,842 Views)

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

0 Kudos
Message 2 of 12
(4,837 Views)

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.

---------------------------------------------------------------------
LabVIEW 2013, Windows 7

He who asks the question is a fool for five minutes; he who does not ask the question remains a fool forever.
0 Kudos
Message 3 of 12
(4,831 Views)

Strange, because when I do it, this is what I get (looks like 0,0 is in the center to me):

 

Graph Axes.png

 

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

0 Kudos
Message 4 of 12
(4,825 Views)

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.

---------------------------------------------------------------------
LabVIEW 2013, Windows 7

He who asks the question is a fool for five minutes; he who does not ask the question remains a fool forever.
0 Kudos
Message 5 of 12
(4,821 Views)

@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?

0 Kudos
Message 6 of 12
(4,808 Views)

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?

---------------------------------------------------------------------
LabVIEW 2013, Windows 7

He who asks the question is a fool for five minutes; he who does not ask the question remains a fool forever.
0 Kudos
Message 7 of 12
(4,791 Views)

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.

 

 

0 Kudos
Message 8 of 12
(4,778 Views)

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

0 Kudos
Message 9 of 12
(4,774 Views)

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?

---------------------------------------------------------------------
LabVIEW 2013, Windows 7

He who asks the question is a fool for five minutes; he who does not ask the question remains a fool forever.
0 Kudos
Message 10 of 12
(4,753 Views)