LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Yaxis Sync on Graph

Hi i would like a little help..
I have a graph were i'm plotting some points..
I use both (left and right)Yaxis..
The left yaxis is showing the real position of the point (based on CVI's ZeroPoint) and the right using an offset. what i want is the right Yaxis to show always the point with an offset value (e.g 5).
lets see an example..
PlotPoint(...,x,y);
SetGraphCursor(...,x,y);
now the cursor horizontal line is showing the y value on the Left Yaxis and y+5 on the right yaxis.
off course i want to zoom and pan with no problems and i would like o be able to use auto scale for the new points how can i do this..?
i managed to make this using ATTR_ACTIVE_YAXIS attribute and ATTR_ACTIVE_YAXIS but when i add new points to the graph they dont scale equally so the right Yaxis (offset) is not correct..
0 Kudos
Message 1 of 3
(2,966 Views)

Hello karpa,

If I'm understanding you correctly, you want the right y-axis to always have the same min/max as the left y-axis, but with an offset of 5, so that its markers always show a value 5 points higher than those of the left y-axis? And you have the left y-axis autoscaling to the data that you're plotting?

If the problem you're having is that each time you plot, the left min/max of the left y-axis changes, and causes the two axes to be out of sync, why couldn't you, after every plot, programmatically get the min/max of the left y-axis (using the GetAxisScalingMode function) and then set the min/max of the right y-axis accordingly (using SetAxisScalingMode)? Does that make sense?

If this is what you want to do, you have no need to use ATTR_ACTIVE_YAXIS, since all your plots and cursors would be associated with the left y-axis.

Luis

0 Kudos
Message 2 of 3
(2,954 Views)
Thanks Luis it seems to work ok..
0 Kudos
Message 3 of 3
(2,905 Views)