Range field in Android Plot (0.6.1.) is not showing the entire number - androidplot

I create a simple xyseries with a boundary and set the mode to AUTO.
The range of values I set is between 103 and 107. I am getting constant updates between these values and can I redraw the plot when it goes over size=20.
The Y axis seems to only take two digits and not the entre number. This is the code.
plot.setRangeBoundaries(0, 200.0, BoundaryMode.AUTO);
plot.setDomainBoundaries(0, 20, BoundaryMode.AUTO);
In the graph I am seeing the following on the Y axis and X axis with the dynamic graph. The Y axis should start from 103.0 to 107.0 but seems they are getting truncated.
07.0
05.7
04.3
03.0
0.0 2.2 4.4 6.7 8.9 11.1 13.3 15.6 17.8 20.0
My question is:
1. Y axis value is truncated on the first digit. They should be 103.0 to 107.0 but they are 03.0 to 07.0.
2. Is there a way to set the Y axis to a whole number?

The missing digit(s) are most likely getting clipped by the graphWidget's margin. Try giving it more room by adding this to your XYPlot's xml config:
androidPlot.graphWidget.marginLeft="30dp"
As far as setting the Y axis to a whole number - sure you can. This doc explains what's going on. What you're probably wanting to do can be accomplished by adding this to your Activity's onCreate() method:
plot.setRangeStep(XYStepMode.INCREMENT_BY_VAL, 1);

Related

Create a graph in Excel - y variable is binary?

I am trying to create a graph where:
X1 5 10 15 20
X2 10 20 25 30
Y 0 1 1 0
X1 is a minimum value of something, X2 the maximum, and Y the binary outcome--was my event true or not. In my head I picture it as a scatter plot where the horizontal axis is my min, the vertical my max, and there is a color coded dot that shows whether the event is true or not. I can't seem to create this.
I am not aware of a way to do this directly in Excel. As a workaround, you could sort your data by column Y. Then make a scatter plot of the the data where Y=0. Then you manually add the data where Y=1 as a second "series", i.e. right click the chart and click on Select Data, then on Add (Excel 2007).

I want to change the Y axis of a graphic (excel)

I want to modify to y axis in "image1" so that the values range from 0 to 7 rather than from 0 to 18.
I attach my example (image1) and an original example (image3)
thank you for your help
Image 1
Image 3
click on your graph. Select the Y axis. Set you min and max values to what you want instead of automatic.

Fitting Axis and of Y and X in Excel

I have the following Graph: The Y values are located at X= 32,64,128,256, 512 and 1024. However, the graph shows different values. I would like to show for X-axis labels only the relevant values (i.e.32,64,128,256, 512 and 1024).
In addition, I would like to add the maximal value of 1 to Y-axis. As can be seen I defined the maximal value to be 1 but the graph doesn't show it.
How can I fix these 2 issues both in X-axis and in Y-axis?
For the X-axis: tick the check box "Logarithmic scale" and set the Base to 2.
For the Y-axis: set the Minimum to a value that is divisible by the Major unit 0.1, for example to 0.4.
Thanks to Hans Vogelaar (http://www.eileenslounge.com) for the answer.

How to plot two scatter-plots on the same chart?

I have two series that overlay pretty close in time but not exactly. So I need to plot each series with the corresponding time component to get the match. Also the number of points is different, by a factor of 10.
How to plot two scatter-plots on the same plot using the time domain as the x-axis? eg
t1: 0.1 0.3 0.5 ...
y1: 3 7 9 ...
t2: 0.18 0.21 0.34 0.41 0.56 ...
y2: 32 55 4 7 1 ...
As you can see I can't just highlight all because the series don't match up so well in time.
If output something like this is what you want:
then it may be simplest to plot one series (say y1), select the Plot Area, Select Data... and add your second (y2) series.
It's also pretty easy to make the chart using the first range, then copy the X and Y values for the second series (hopefully it's in adjacent columns, but you can use Ctrl+Select to select multiple areas). Then select the chart, and use Paste Special to add the copied data as a new series, in columns, X values in first column.

Gnuplot: Plotting multiple series on graph, but number of different series to overlay unknown ahead of time

I am trying to write a script wrapping gnuplot that will take a dataset and produce an overlayed graph, the number of series to be plotted based on the number of distinct values in a given column, or based on the number of different datasets in the file. An example file would be:
#SeriesName x y
Series1 0 10
Series1 1 11
Series1 2 13
...
SeriesN 0 14
SeriesN 1 19
SeriesN 2 15
I have this in one continuous set of lines, but I can split it into index-able chunks if necessary. The problem is that I don't know the different names of the SeriesName values I'll have ahead of time, nor how many of distinct values there will be. But I want one line on the graph per distinct value of SeriesName. I can see how to make graphs if I know ahead of time the different values of SeriesName, but I don't know how to tell gnuplot to "make one line per value of series, and label each line with the name that is the value of SeriesName that was used for each line."
Can gnuplot do this? Otherwise, I can make two passes through the data, the first one of which I will gather the unique values of SeriesName, and then use bash/perl/python to explicitly build a `plot' statement, but it seems like gnuplot should have some functionality for a user to have to avoid that. Am I missing something?
Thanks in advance.
Update: I also posted to a forum to where the author of Gnuplot in Action (Philipp Janert) posts, and I posted a workaround to my own problem, but I don't think it qualifies as an answer, as what it ultimately does is make a second run through the data and then does a source code filter on gnuplot commands to make a gnuplot script compliant with a particular dataset. I would think that there would be an answer using just the syntax of gnuplot better than what I did. For reference, here is the link: http://www.manning-sandbox.com/thread.jspa?messageID=122752#122752
Just for the records, here is a solution which works with gnuplot>=4.4.0 and gnuplot 5.x.
When the series label changes in column 1 it will be added to a string. This string will be used later to plot the legend.
Data: SO8812078.dat
#SeriesName x y
Series1 0 10
Series1 1 11
Series1 2 13
Series2 0 12
Series2 1 13
Series2 2 14
SeriesN 0 14
SeriesN 1 19
Script: (works with gnuplot>=4.4.0, March 2010)
### take legend from column
reset
FILE = "SO8812078.dat"
myTitles = ''
set key noautotitle
plot t1='' FILE u (t0=t1,t1=strcol(1),t0 ne t1?myTitles=myTitles.' '.t1:0,$2):3:(words(myTitles)) w lp pt 7 lc var, \
for [i=0:words(myTitles)] 1/0 w lp pt 7 lc i ti word(myTitles,i)
### end of script
Result: (created with gnuplot 4.4.0)

Resources