Coloring category plots
Larry Hutchinson
I am trying to figure out how to color an individual bar of a category
plot. It seem slike the f(z) only affects the line but not the fill
of the bar. Ideally I would like a combination of black line/white
fill and no line/gray fill, but black line for the second type would
be OK.
To do this, you will need to split your data into two waves, one with a NaN at the position of your special bar, and the other with NaN every place but the special loc. Then plot using keep with next mode and apply any custom settings you like.
For example, given original data like so and the desire to make bar index 6 special:
Make/N=10 odata=1+gnoise(0.2);Make/O/T cdata="cat "+num2istr(p)
Duplicate/O odata,allbut;allbut[6]=NaN
Duplicate/O odata,justone;justone= NaN;justone[6]=odata[6]
Display allbut,justone vs cdata
ModifyGraph toMode(allbut)=-1
ModifyGraph usePlusRGB(justone)=1,rgb(justone)=(1,4,52428)
ModifyGraph plusRGB(justone)=(65535,43690,0)
SetAxis/A/E=1 left
Duplicate/O odata,allbut;allbut[6]=NaN
Duplicate/O odata,justone;justone= NaN;justone[6]=odata[6]
Display allbut,justone vs cdata
ModifyGraph toMode(allbut)=-1
ModifyGraph usePlusRGB(justone)=1,rgb(justone)=(1,4,52428)
ModifyGraph plusRGB(justone)=(65535,43690,0)
SetAxis/A/E=1 left
August 23, 2007 at 08:10 pm - Permalink