Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > Gnuplot interactive function plotter > Re: Changing th...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 3378 of 3637
Post > Topic >>

Re: Changing the range for part of a plot

by merritt@[EMAIL PROTECTED] Jun 24, 2008 at 01:00 PM

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
 




 5 Posts in Topic:
Changing the range for part of a plot
philkime <Philip@[EMAI  2008-06-24 12:30:28 
Re: Changing the range for part of a plot
merritt@[EMAIL PROTECTED]  2008-06-24 13:00:34 
Re: Changing the range for part of a plot
philkime <Philip@[EMAI  2008-06-24 14:27:19 
Re: Changing the range for part of a plot
googoff@[EMAIL PROTECTED]  2008-06-25 04:21:38 
Re: Changing the range for part of a plot
philkime <Philip@[EMAI  2008-06-27 20:08:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 5:44:42 CST 2008.