Graphs
GeraldJames
I have a dataset with date/time as the key value with other linked valies of H2O, dD, d and d18O which vary randomly over time.
I would like to make a graph which is one colour for H2O under a certain value and another colour for H2O over this value in order to show the limit of a previous variable. However since the high and low h2O values are jumbles throughout the dataset I'm not sure how to do this. Basically I'm just looking for a way to say all h2O values>30,000ppm = blue. and all h2O values < 30,000 = red.
Does anyone have any ideas?
red = h2o <= 30000 ? h2o : NaN
blue = h2o > 30000 ? h2o : NaN
October 9, 2013 at 12:39 am - Permalink
modifygraph zColorMin=(65535,0,0) // red
ModifyGraph zColor(wave0)={wave0,30000,30000,Rainbow,0}
Note: You need to substitute "wave0" for the name of your wave.
I have not thoroughly tested this.
Hope this helps,
Kurt
October 9, 2013 at 12:39 am - Permalink
October 9, 2013 at 02:52 am - Permalink
ModifyGraph zColor(wave0)={wColour,0,16,Rainbow16,0}
Simply repeat the last line for each of your other waves on the plot.
Regards,
Kurt
October 9, 2013 at 08:08 am - Permalink
October 9, 2013 at 05:35 pm - Permalink
Yes - just set the corresponding value in wColour (in the example I gave earlier) to a different value - e.g. 7 for green in Rainbow16.
October 9, 2013 at 11:00 pm - Permalink
October 10, 2013 at 01:32 am - Permalink
Try this function, it should illustrate the solution:
Make/O/N=5 wave0,wave1
wave0={25000,31000,45000,28000,32000} // the data that determines colour
wave1={5,4.5,4,3,6} // some other data
Make/O/N=5 wColour // the wave that indicates colour
variable i
for(i = 0 ; i < DimSize(wave0,0) ; i += 1 )
if(wave0[i] < 30000)
wColour[i] = 0 // red in Rainbow16
elseif(wave0[i] >40000)
wColour[i] = 7 // green in Rainbow16
else
wColour[i] = 11 // blue in Rainbow16
endif
endfor
Display wave0
AppendToGraph/R wave1
ModifyGraph mode=3,marker(wave0)=16,marker(wave1)=17 // wave0:squares, wave1:triangles
ModifyGraph zColor(wave0)={wColour,0,16,Rainbow16,0}
ModifyGraph zColor(wave1)={wColour,0,16,Rainbow16,0}
End
If you want different colours try different values in wColour.
October 10, 2013 at 02:10 am - Permalink
October 10, 2013 at 02:30 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
October 10, 2013 at 09:06 am - Permalink