In article
<fb84a9cf-b589-4555-bf03-fcd77e552875@[EMAIL PROTECTED]
>,
philkime <Philip@[EMAIL PROTECTED]
> wrote:
>I wanted to change the linecolour for half of the datapoints in a
>column of data but I can't work out if this is possible?
>
>If the line data is in one column like this (using comma as delimiter)
>(first two columns are histogram):
>
>"xlabel1",45,10
>"xlabel2",67,10
>
>I suppose I'd need to do something like this:
>
>plot "file.csv" using 2:xticlabels(1) linecolor rgb 'blue' title
>"Response Time",\
> [0:50] '' using 0:3 with lines linewidth 3 linecolor rgb 'red'
>title "Median Response Time (points 1-50)",\
> [51:100] '' using 0:3 with lines linewidth 3 linecolor rgb
>'green' title "Median Response Time (points 51-100)"
>
>but of course this is all illegal syntax because ranges apply to the
>whole plot and have to be the first argument to plot. Also, I don't
>know how to start the x coord at anything other than 0 and have it
>autoincrement as with the special "0" value.
There are many ways. The simplest is something like
plot 'foo' using 0:($0 < 50 ? $3 : NaN) lc rgb "red", \
'' using 0:($0 < 50 ? NaN : $3) lc rgb "green"
>
>I ended up having to split the median column into two columns like
>this:
>
>"xlabel1",45,10,
>"xlabel2",45,10,
>.
>.
>.
>"xlabel50",45,10,
>"xlabel51",67,,10
>.
>.
>.
>
>and then plot with
>
>plot "file.csv" using 2:xticlabels(1) linecolor rgb 'blue' title
>"Response Time",\
> '' using 0:3 with lines linewidth 3 linecolor rgb 'red' title
>"Median Response Time (points 1-50)",\
> '' using 0:4 with lines linewidth 3 linecolor rgb 'green' title
>"Median Response Time (points 51-100)"
>
>
>Any ideas on how I could do this without messing about with the data
>file? I can't use separate plot commands as of course that just
>overwrites the previous plot. And multiplot doesn't work because the
>first part of the plot is a histogram with words as xticlabels so the
>second multiplot doesn't line up at all with the first one.
--
Ethan A Merritt


|