10-26-2012 04:45 AM
Dear All,
Please find attached a copy of some code which has the effect Kentmey desires in LabVIEW v11. I know that this code is poor - I wouldn't reccomend using insert into array or XY graph inside a while loop but the code is really to demonstrate how to use the XY graph property node using XScale and Y.Scale minimum and maximum values to generate a `manual auto-scale' if you like.
Regards,
10-26-2012 08:26 AM
I managed to achieve something even nicer actually.
Size of the graph dynamically changing with the data.
10-26-2012 09:46 AM
Which ensures that the scale always remains orthonormal AND the graph still autoscales.
10-26-2012 10:46 AM - edited 10-26-2012 10:47 AM
I don't think it is a good idea to set the plot size programmatically. What if somebody would enter 1000000, for example.
I would always keep the graph size constant, make the plot area square, and set the x and y scale the same, based of the absolute max of all x and y values.
Sice you are clearing data on each call, it is absolutely not necessary to use the build xy graph express VI and going to dynamic data. That's just way too much! Simply create a complex array as folllows and you are all done:
10-26-2012 11:04 AM
What about this version?
In this version of my software, this works absolutely fine (this piece of code is integrated into a bigger software, people don't write data in). Does the job nicely and work for me.
Kentmey
10-26-2012 11:29 AM
Doesn't look much different to your earlier attempt.
You still did not disable "autoadjust scales" from the right-click...advanced menu as I recommended. This means that if e.g. the y scale needs more space, (e.g. because the numbers are bigger), the plot area will randomly change. This needs to be disabled!
10-26-2012 11:36 AM
10-26-2012 11:53 AM - edited 10-26-2012 11:55 AM
OK. If you disable "autoadjust scales" you would not need to mess with the size at all at run time.
10-26-2012 12:05 PM