LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY Graph - Autoscale + fixed margins

Solved!
Go to solution

Hello,

 

Total newb here.  I am currently plotting a circle on an XY Graph where the radius can be varied, so I have the x and y axis set to "Autoscale".  However, the autoscale  makes the edge of the circle go right up against the edge of the top, bottom, left and right boundaries of the plot region.  I would like to add a "margin", mainly for aesthetic purposes, so that there is some fixed amount of space between the plotted circle and the boundaries of the plot region. Hope this makes sense.  I am attaching pictures that I have created with autoscale OFF to try and help illustrate what I am after here.  Any help or guidance is appreciated.

 

Regards,

Doug

Download All
0 Kudos
Message 1 of 8
(5,771 Views)

turn auto scaling off

You need to use property scale min-max form scale > range.

Ofcourse you know the radius and centre of circle so give the value of the scale accordingly. 

Message 2 of 8
(5,759 Views)

Thanks for your reply.  Just to clear, I would like to keep autoscale ON but also have a margin so that no matter what the size of the circle is, it looks good on the graph.  Looks like you are recommending a property node on the XY Graph.  I will explore that.  Thanks.

0 Kudos
Message 3 of 8
(5,754 Views)
Solution
Accepted by topic author Doug77

Hello Doug,

 

You should be able to add some buffer space by enabling the "Loose Fit" option in the right click>>(x,y) Scale menu.  This will round the autoscale to multiples of the Scaling Factors "Multiplier" value set in the Scale Properties window. 

 

Of course, you'll still need to make an educated decision about what a good multiple would be, and this depends on the range of sizes you'll need to display.  If you need to go any more granular or dynamic than this allows (such as always scaling the graph to 1.05x the radius of the circle), then yes, you'll need to use the graph range property nodes.

 

Regards,

Tom L.
Message 4 of 8
(5,724 Views)

Thanks Tom, that appears to be exactly what I am looking for.  If/Once I am successful I will follow up on this thread.  Property Nodes in general are a bit beyond me at this point so I have some legwork to do. Thanks again.

 

Doug

0 Kudos
Message 5 of 8
(5,713 Views)

Glad to help!

 

Property nodes are extremely powerful and allow you to manipulate things during runtime that you'd otherwise have to set statically while developing your application.  There's a pretty good 12-minute intro video to property nodes here:

 

EnableEngVideo: LabVIEW Tutorial 17 - Property Node (Enable Integration) (you'll have to click through to the video due to posting rules, but the link is legitimate)

http://www.youtube.com/all_comments?v=DYaUqW6sbYY  

 

I'm not endorsing this video, but it's definitely approachable if you're new to LabVIEW.  The LabVIEW Core training (available for free online if you've got a support contract) also covers properties and methods pretty extensively- they really unlock a lot of possibilities.

 

Regards,

Tom L.
Message 6 of 8
(5,702 Views)

And hopefully in the future the in-built autoscaling will be able to take some inputs that adjusts it behaviour. Like this for example:

 

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Restricted-autoscaling/idi-p/1127043

Message 7 of 8
(5,692 Views)

Thanks once again, Tom. Your recommendations have worked for me.  And yes, just as you mentioned, finding a multiplier that works for any given radius has been a bit of a challenge. I'm not quite there yet, but the property nodes for the x and y scale are working as expected, and are a very cool feature IMO.  I have moved on from the circle plotting to a Fourier Expansion Square Wave plotter.  I am attaching pictures.  Right now, the extra buffer of space is dependent on the x-axis step increment (resolution), but I know that ultimately this is not the way to go.  I need to tinker with it a bit more, and figure out what the extra space should be dependent on.

 

 

I can't say thanks enough times to everyone who responded.  What an awesome community NI has going here 🙂

 

Regards,
Doug

Download All
0 Kudos
Message 8 of 8
(5,663 Views)