Google charts scatterplot turning OFF autoscaling - gwt

I am using a GWT scatter plot. Data values are going to range from 0 to 100 and are arriving in in time. I am plotting the data points as they arrive as a time sequence. I would like to fix the range of y values so that the y axis does not auto-scale. Right now, the max and min y values keep changing with time and this is quite confusing to the user.
Does anybody know how I can achieve this?
Thank you in advance for your replies.
Regards,
Ranga

I figured out how to do this. Create a vertical axis and set the max and min values for that vertical axis. Then use that vertical axis to create the plot.
VAxis vaxis = VAxis.create("Occupancy %");
vaxis.setMaxValue(100.0);
vaxis.setMinValue(0);
occupancyPlotOptions.setVAxis(vaxis);
Hope the answer (to my own question) helps others.
Ranga

Related

Offset lineplot from Y-axis

I am working with a data stream and for different time points in this stream I have density estimates over a fixed set of X values.
Each of these sets of estimates would look something like this
I'd like to plot multiple curves like this sideways, similar to how it's done in this answer
I've looked through the documentation regarding plotting but didn't find a straight-forward solution for it.
While it's easy to turn such a plot sideways by simply switching the axes, I didn't find a possibility to offset this from the Y-axis
Does anyone have an idea how to tackle this?
Instead of plotting
plot(x,y)
plot
plot(k+y,x)
where k is the location of the plot along the x axis (2 or 4 in your example).

Change the distance between x-axis lables of a plot in MATLAB

I plot the following figure and I want to decrease the distance between x axis labels for example the distance between 1 and 2 or 2 and 3.
I do not know how can I do that !!!
I found these pages 1 and 2 but I could not know how should I write those codes without getting exceptions. Since, I am not familiar with Matlab environment.
The simple way is resize your figure or change it's position. It would change the distance.

How to modify the offset position of y-axis values in matlab

I want to shift my wave which i plotted to above the offset, for example offset value of my plot is -5000, then i want to shift my whole graph y axis to above -5000 thats means above my offset value.
does any one have any idea regarding this??
Yes I had used the same idea for another plot
offset=(delta_rear_front_1 + 0.5*10^4);
y=delta_rear_front_1+offset;
a=plot(datastructs.SpringWayOut.mConfCircle_time,y,'red')
Thank anyway, actually I was complicating things and I got that and I had done it

How to calibrate axis in Matlab?

Hello people of the interwebs!
My question is pretty simple. I want to change the horizontal and vertical axis scale? As you can see en the picture below I would like to have the value 1332 instead of ~ 3750 where you see a very clear blue line. How do I achieve this?
I appreciate all the help I can get!
Thanks in advance! :)
The values on the axis are based on your data, so the best option would really be to scale the data you plot, e.g. instead of plotting:
plot(x,y,'b.')
plot something like:
plot(x*1332/3750,y*1332/3750,'b.') % assuming same scaling factor on both axes
The other option, which is not so good in my opinion, is to change the axes ticks after plotting:
current_xticks = get(gca,'XTick');
new_xticks = current_xticks * 1332,3750;
set(gca,'XTick',new_xticks);
current_yticks = get(gca,'YTick');
new_yticks = current_yticks * 1332,3750; % assuming same scaling factor on both axes
set(gca,'YTick',new_yticks);

Overlapping data points and spacing

I have a set of data that I plot but the points on the graphs are so closed to each other that you can't see them well nd neither their values because even when I zoom in I can't get to them all. Now what I want to do is to space them out without changing their actual values on the graph. Is the a function or any other ways to do that? I've tried changing the axis and the scale but it didn't help. Mostly those points are in the Y direction. Please help What I really mean is though these points are closed to each other I'd like to create and interval between them so they don't pile up on each other
You can make the vector you are trying to plot to be more sparse taking points after some defined intervals:
plot(x(1:10:end),y(1:10:end))
In this example, I plotted each tenth point. Does it help?