LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

axis labels / scaling in CVI2013 SP1

It appears that the scaling of axes has been changed in SP1 of CVI2013...

 

Following scenario:

 

linearly scaled y axis, two plots, according to the data axis range should start at zero (autoscaling)

 

The green plot on the graph remains unchanged, but I can add a large value (10000) to the orange plot, in this case the plot actually shows the expected value (left figure below)

If I undo the addition of the constant offset to the orange plot, i.e. subtract 10000 from all y values of the orange curve, the lower axis range is some small value, this depends... say 1e-63 or so (right figure below, both curves overlap so only the green one is visible)

 

This does not make sense to me.

 

Of course there will be rounding errors involved, so after adding and subtracting some value the original baseline may not be exactly zero anymore, so lets assume it's a little bit larger, 1e-63. BUT THE GREEN LINE HAS NOT CHANGED, and obviously the minimum of the green line is zero... And zero is smaller than 1e-63...

 

y-axis-1.png      y-axis-2.png

 

No, it's not April 1st Smiley Wink

0 Kudos
Message 1 of 4
(4,105 Views)

Hi Wolfgang,

 

could you send me the  part of your project which causes this problem ? I would like to see it to find the source of the inaccurate display of the green plot.

 

As far as I know your problem, I have one question: Why do you use autoscaling? You said, that the axis range should start at zero, so you could set the minimum value of the axis to zero in the graph properties.  When you want to have a changing maximum value, you could reset it int the code with a variable depending on the y values of the plot.

Thus the minimum value would not change although you change the values of the plots and the display still depends on the new values.

 

Kind regards,

Janina

0 Kudos
Message 2 of 4
(4,082 Views)

Hello Wolfgang,

 

Could you post the code code that reproduces this problem.

I tried the following code:

	double x[3] = {0.000001, 0.0005, 0.001};
	double y_1[3] = {0.0, 0.0, 0.0};
	double y_2[3] = {10000.0, 10000.0, 10000.0};
	int i;  
	int plot_handle = 0;
...
	PlotXY(panelHandle, PANEL_GRAPH, x, y_1, 3, VAL_DOUBLE, VAL_DOUBLE, VAL_FAT_LINE, VAL_NO_POINT, VAL_SOLID, 1, VAL_GREEN);
	plot_handle = PlotXY(panelHandle, PANEL_GRAPH, x, y_2, 3, VAL_DOUBLE, VAL_DOUBLE, VAL_FAT_LINE, VAL_NO_POINT, VAL_SOLID, 1, VAL_YELLOW);
	for(i = 0; i < 3; i++)
		y_2[i] -= 10000.0;
	Delay(2);
	DeleteGraphPlot(panelHandle, PANEL_GRAPH, plot_handle, VAL_IMMEDIATE_DRAW);
	plot_handle = PlotXY(panelHandle, PANEL_GRAPH, x, y_2, 3, VAL_DOUBLE, VAL_DOUBLE, VAL_FAT_LINE, VAL_NO_POINT, VAL_SOLID, 1, VAL_YELLOW);

 My graphs look like this:

1.png2.png

 

Thanks,

Constantin

0 Kudos
Message 3 of 4
(4,019 Views)

Hi Constantin,

 

I already started to work on a demo but I have to extract it from a large project without removing the 'critical' calls, so it may take some time, but rest assured I will post back even if it turns out to be my mistake 😉

0 Kudos
Message 4 of 4
(4,014 Views)