LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

orthonormal scale

Solved!
Go to solution

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,

Robert Ward
Applications Engineer, NI
0 Kudos
Message 21 of 29
(1,129 Views)

I managed to achieve something even nicer actually.

Size of the graph dynamically changing with the data.

 

Kentmey
0 Kudos
Message 22 of 29
(1,115 Views)

Which ensures that the scale always remains orthonormal AND the graph still autoscales.

Kentmey
0 Kudos
Message 23 of 29
(1,111 Views)

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:

 

 

 

0 Kudos
Message 24 of 29
(1,103 Views)

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

Kentmey
0 Kudos
Message 25 of 29
(1,096 Views)

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!

0 Kudos
Message 26 of 29
(1,093 Views)
Actually not. try with big numbers, you will see
Kentmey
0 Kudos
Message 27 of 29
(1,086 Views)

OK. If you disable "autoadjust scales" you would not need to mess with the size at all at run time.

Message 28 of 29
(1,083 Views)
Ok
Kentmey
0 Kudos
Message 29 of 29
(1,073 Views)