LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is It Possible to Have an Axis Scale with two Zeros?

Greetings All,

 

I am currently working on modifying a plot for a program that runs an object through 360 degrees and would like the x axis (degrees) display to reset to zero whenever I scroll past 360 to the right, or reset to 360 whenever I scroll past zero to the left.  The reason I would like to add this feature is because the program will frequently be used to "zoom" in on 30 degree intervals. So let's say I centered my graph at 0 degrees.  Then I would like it's Min to display as 345 degrees, and its Max to display as 15 degrees.  As it is, right now my program displays -15 as the Min and 15 as the Max.   

 

Does anyone know of any possible way of doing this without manually editing the values on the axis?

0 Kudos
Message 1 of 9
(4,005 Views)

A couple of clarifications. 

 

1) The collected data is being plotted on an XY Graph. 

 

2) When the user specifies what degree width to 'zoom' to (there are four options), the graph changes its scale parameters to reflect this change. 

0 Kudos
Message 2 of 9
(3,995 Views)
Could you show us a screen shot?
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 3 of 9
(3,989 Views)

I've attached two (cropped) screenshots showing the X-axis for when the plot is centered at 0 degrees and for when the plot is centered at 360 degrees.  In both cases, the plot has a width of 38 degrees.  Unfortunately, the plot is too wide to fit on one screen, but you can surmise that for a 0 degree center it goes from [-19,19] and for a 360 degree center, it goes from [341, 379].

 

This is what I want the axis to actually display left to right:

 

0 Degree Center

 

341, 342, 343, 344...359, 360/0, 1, 2... 15, 16, 17, 18, 19

 

360 Degree Center

 

341, 342, 343, 344...359, 360/0, 1, 2... 15, 16, 17, 18, 19

 

 

So Both centers should display the same, since they are at the same angular position.  Hope this clarifies things a bit.  Thanks. 

 

 

Download All
0 Kudos
Message 4 of 9
(3,973 Views)

I don't think there is a direct way. Probably easiest would be to make your own graph using a picture indicator.

 

Open the example finder and have a look at the example "xy multi plot.vi". Maybe you can modify it for your purpose.

0 Kudos
Message 5 of 9
(3,952 Views)
Like Altenbach said, I don't think there is any direct or easy way. Here is a simple vi that I made. It's not a solution, but some food for thought.
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
Message 6 of 9
(3,945 Views)

You could also add two x-axes and have the second one as x+360. (See image).

 

Message Edited by altenbach on 03-18-2009 01:43 PM
Message 7 of 9
(3,940 Views)

Thanks for the input.

 

Unfortunately, overlaying the axis with an image that changes dynamically is well beyond the scope of my present knoweledge of LabVIEW and it seems like it will be more trouble than it's worth.  For now, I think I'll just allow the option for the user to modify it.

 

 

0 Kudos
Message 8 of 9
(3,923 Views)

OK, I think I've come up with a fairly easy solution/work around.  I would create two invisible graphs, one whose x axis runs up to 360/0 degrees from some start position, the other, whose axis runs up to the min of the first axis.  I would place the first axis directly to the left of the second one, and programmatically resize them such that they perfectly overlay the original graph's axis in the correct position. 

 

Example:

 

               Original:

                                                -20, - 19, .... -1, 0, 1, ...... 14 15 16

 

               2nd Axis

                                                340, 341, ....   0

               3rd Axis                    1, 2, ... 14, 15, 16

 

Make Original Invisible, then have 3rd axis directly to right of 2nd, and resize two invisible graphs to correct sizes to get perfect overlay over first axis.

 

This seems the easiest solution for me given that my program prints different ranged axes depending on what degree width I wish to zoom into.

 

Anyone see any potential problems with this solution?

 

 

0 Kudos
Message 9 of 9
(3,875 Views)