Simple syntax exception to plot many points against one?
gsb
here's an example of the syntax I'm thinking of:
make/o/n=(3,3) mydata
SetDimLabel 0,0,time0val,mydata; SetDimLabel 0,1,time1val,mydata;SetDimLabel 0,2,temperature,mydata;
SetDimLabel 1,0,condition0,mydata;SetDimLabel 1,1,condition1,mydata;SetDimLabel 1,2,condition2,mydata;
mydata={{-1,10,33},{-0.5,11,35},{-2,12,37}}
display/k=1 mydata[1][*] vs mydata[2][(] //a normal use
display/k=1 mydata[0,1][0] vs mydata[2,*;0][0] //Wish this worked! (Surprisingly, there is no error. However, it plots starting from a row index for the x-values that is not 2.)
SetDimLabel 0,0,time0val,mydata; SetDimLabel 0,1,time1val,mydata;SetDimLabel 0,2,temperature,mydata;
SetDimLabel 1,0,condition0,mydata;SetDimLabel 1,1,condition1,mydata;SetDimLabel 1,2,condition2,mydata;
mydata={{-1,10,33},{-0.5,11,35},{-2,12,37}}
display/k=1 mydata[1][*] vs mydata[2][(] //a normal use
display/k=1 mydata[0,1][0] vs mydata[2,*;0][0] //Wish this worked! (Surprisingly, there is no error. However, it plots starting from a row index for the x-values that is not 2.)
This syntax would alleviate the need -- unless there are alternatives that I should consider (?) -- to create extra wave points (redundantly containing the same data) serving as placeholders for the repeated x value.
January 17, 2018 at 04:59 pm - Permalink
latitudes0 = 0 //store the latitude at which this group's height was measured
heights0 = gnoise(66) //make up some heights for this group
make/o/n=10 heights1,latitudes1
latitudes1 = 23 //store the latitude at which this group's height was measured
heights1 = gnoise(70)//make up some heights for this group
display/k=1 heights0 vs latitudes0
appendtograph heights1 vs latitudes1
ModifyGraph mode=3,marker=8
But since the latitude parameters are constant within each group, you could also store the data as follows, without as much redundancy. The only issue is that I don't believe that one can make the same plot of the data in any straightforward way (though you could probably get close with offsets and muloffsets, for instance)
group0[0]=0;setdimlabel 0,0,latitude,group0 //store the latitude at which this group's height was measured (dimension label for clarity)
group0[1,*]=gnoise(66) //make up some heights for this group
make/o/n=11 group1
group1[0]=23;setdimlabel 0,0,latitude,group1 //store the latitude at which this group's height was measured (dimension label for clarity)
group1[1,*]=gnoise(70) //make up some heights for this group
//currently, to plot the data as above, you'd have to make a wave containing a latitude for each height measurement
//I think it would be great if this syntax made the same plot as above:
display/k=1 group0[1,*] vs group0[0,*;0] //these plots produce (what to me appears to be) unexpected results
appendtograph group1[1,*] vs group1[0,*;0]
ModifyGraph mode=3,marker=8
A category plot would be fine for this simple two group situation, but imagine if you had measurements from hundreds of latitudes, as well as more data like the temperature at each latitude. This syntax would help to avoid (unnecessarily) replicating data, which then has to be kept organized. I find myself wanting to plot this way fairly often.
January 18, 2018 at 06:53 am - Permalink
Extract
.January 18, 2018 at 07:56 am - Permalink
To my mind, the extent to which that becomes a problem depends on the dataset's size (e.g., how many different groups) and complexity (e.g., how many different parameters are measured for each group).
January 18, 2018 at 08:47 am - Permalink
In addition, you can request "jitter" for the data points to spread out overlapping points. That way, these plots can also to some degree replace the Scatter Dot Plot package.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 18, 2018 at 03:15 pm - Permalink
SetScale/P x 23,0.2,"", heights1
Display heights0,heights1
ModifyGraph mode=3
SetAxis bottom -2,27
While this is not as smart as the ScatterDotPlot Package, it has the advantage to maintain the order of the datapoints. I needed this because I had to make a scatter dot plot were the datapoints in the individual waves corresponded to each other. The first datapoint in wave1 should have the same symbol as the first datapoint in wave2 etc.
Greetings,
Klaus
January 19, 2018 at 12:56 am - Permalink
(Still think it would be really nice if increments of zero were supported. Shouldn't it at least throw an error otherwise?)
January 19, 2018 at 06:40 am - Permalink