|
From: joachim h. <jh...@jo...> - 2009-05-09 20:42:21
|
Hello - I'm new in gnuplot. I wrote a script which reads single lines with the "every" option. This works well, but I have two questions: 1) I'd love to have the value which is written in column 1 (which is a time in my case) as the legend (key). Is this possible? 2) I have several xy-pairs in a line. I plot them with "myfile.txt" every ::1::1 using 3:2 with imp,\ "" every ::1::1 using 6:5 with imp notitle,\ "" every ::1::1 using 9:8 with imp notitle,\ and so on. Can I change the colors in a way that the first xy-pair (using 3:2 in the example above) is in red colour, and then the color circle is crossed so that the last value is blue? (There are different numbers of pairs; sometimes 6 or 12 or whatever. In each case the first xy-value should be red and the last blue.) Thanks for any help. Best regards - joachim |
|
From: Thomas S. <t.s...@fz...> - 2009-05-11 15:56:36
|
define a palette which goes from 'red' to 'blue, see http://www.gnuplot.info/docs/node215.html and then plot with explicit line colors plot "myfile.txt" every ::1::1 using 3:2 with imp linecolor palette frac 0.0, \ "" every ::1::1 using 6:5 with imp notitle palette frac 0.1, \ "" every ::1::1 using 9:8 with imp notitle palette frac 0.2, \ ... for more information, see http://www.gnuplot.info/docs/node62.html joachim heintz wrote: > > Hello - > > I'm new in gnuplot. I wrote a script which reads single lines with the > "every" option. This works well, but I have two questions: > 1) I'd love to have the value which is written in column 1 (which is a > time in my case) as the legend (key). Is this possible? > 2) I have several xy-pairs in a line. I plot them with > "myfile.txt" every ::1::1 using 3:2 with imp,\ > "" every ::1::1 using 6:5 with imp notitle,\ > "" every ::1::1 using 9:8 with imp notitle,\ > and so on. Can I change the colors in a way that the first xy-pair > (using 3:2 in the example above) is in red colour, and then the color > circle is crossed so that the last value is blue? (There are different > numbers of pairs; sometimes 6 or 12 or whatever. In each case the > first xy-value should be red and the last blue.) > > Thanks for any help. Best regards - > > joachim > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK > i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Gnuplot-info mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://www.nabble.com/Plot-questions-tp23464492p23486189.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: joachim h. <jh...@jo...> - 2009-05-19 21:10:02
|
Thanks a lot for your help. The palette is working now. Unfortunately I have now a large color palette on the right side of my plot. How can I get rid of it? And until now I couldn't find a way to show my first column as a label. Something like 'set label $1' - but what is the correct syntax for it? joachim Am 11.05.2009 um 17:56 schrieb Thomas Sefzick: > > define a palette which goes from 'red' to 'blue, see > http://www.gnuplot.info/docs/node215.html > > and then plot with explicit line colors > > plot "myfile.txt" every ::1::1 using 3:2 with imp linecolor palette > frac > 0.0, \ > "" every ::1::1 using 6:5 with imp notitle palette frac 0.1, \ > "" every ::1::1 using 9:8 with imp notitle palette frac 0.2, \ > ... > > for more information, see > http://www.gnuplot.info/docs/node62.html > > > joachim heintz wrote: >> >> Hello - >> >> I'm new in gnuplot. I wrote a script which reads single lines with >> the >> "every" option. This works well, but I have two questions: >> 1) I'd love to have the value which is written in column 1 (which >> is a >> time in my case) as the legend (key). Is this possible? >> 2) I have several xy-pairs in a line. I plot them with >> "myfile.txt" every ::1::1 using 3:2 with imp,\ >> "" every ::1::1 using 6:5 with imp notitle,\ >> "" every ::1::1 using 9:8 with imp notitle,\ >> and so on. Can I change the colors in a way that the first xy-pair >> (using 3:2 in the example above) is in red colour, and then the color >> circle is crossed so that the last value is blue? (There are >> different >> numbers of pairs; sometimes 6 or 12 or whatever. In each case the >> first xy-value should be red and the last blue.) >> >> Thanks for any help. Best regards - >> >> joachim >> >> ------------------------------------------------------------------------------ >> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! >> Your >> production scanning environment may not be a perfect world - but >> thanks to >> Kodak, there's a perfect scanner to get the job done! With the NEW >> KODAK >> i700 >> Series Scanner you'll get full speed at 300 dpi even with all image >> processing features enabled. http://p.sf.net/sfu/kodak-com >> _______________________________________________ >> Gnuplot-info mailing list >> Gnu...@li... >> https://lists.sourceforge.net/lists/listinfo/gnuplot-info >> >> > > -- > View this message in context: http://www.nabble.com/Plot-questions-tp23464492p23486189.html > Sent from the Gnuplot - User mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! > Your > production scanning environment may not be a perfect world - but > thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW > KODAK i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Gnuplot-info mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > |
|
From: Thomas S. <t.s...@fz...> - 2009-05-20 08:32:29
|
joachim heintz wrote: > > Thanks a lot for your help. The palette is working now. Unfortunately > I have now a large color palette on the right side of my plot. How can > I get rid of it? > 'unset colorbox' see http://www.gnuplot.info/docs/node167.html joachim heintz wrote: > > And until now I couldn't find a way to show my first column as a > label. Something like 'set label $1' - but what is the correct syntax > for it? > to get a data value as a key - within one plot command - first do a dummy plot to get this data value into a variable, and then use this variable for the 'title' of the next plot: plot "myfile.txt" every ::1::1 using (my_key=sprintf("%d",$1),0/0):(0/0) notitle, \ "" every ::1::1 using 3:2 with imp title my_key linecolor palette frac 0.0, \ "" every ::1::1 using 6:5 with imp notitle palette frac 0.1, \ ... to get this data value as a label is a little more complicated because you need to do a complete dummy plot (e.g. into a 'dumb' terminal), then define the label, and afterward do the real plot: set terminal push set terminal dumb plot "myfile.txt" every ::1::1 (my_key=sprintf("%d",$1),0/0):(0/0) set label 1 my_key at ... set terminal pop set output "output_filename" plot "myfile.txt" every ::1::1 using 3:2 with imp notitle linecolor palette frac 0.0, \ "" every ::1::1 using 6:5 with imp notitle palette frac 0.1 notitle, \ ... -- View this message in context: http://www.nabble.com/Plot-questions-tp23464492p23631177.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: joachim h. <jh...@jo...> - 2009-05-20 23:02:24
|
Thanks. 'unset colorbox' does its job. But with you suggestion
regarding getting a data value as a key I get the following:
gnuplot> plot "/Joachim/ShellSkripte/00gnuplot/Ganze1_12pms.txt"
every ::1::1 using (my_key=sprintf("%d",$1),0/0):(0/0) notitle, "/
Joachim/ShellSkripte/00gnuplot/Ganze1_12pms.txt" every ::a::a using
3:2 with imp title my_key linecolor palette frac 0, "/Joachim/
ShellSkripte/00gnuplot/Ganze1_12pms.txt" every ::a::a using 6:5 with
imp title my_key linecolor palette frac .333333, "/Joachim/
ShellSkripte/00gnuplot/Ganze1_12pms.txt" every ::a::a using 9:8 with
imp title my_key linecolor palette frac .666666
^
"/tmp/gnupl005512.txt", line 7: ')' expected
(no newlines in the terminal output; just in this email)
Am I doing something wrong? No idea which ')' I am missing.
joachim
Am 20.05.2009 um 10:32 schrieb Thomas Sefzick:
>
>
> joachim heintz wrote:
>>
>> Thanks a lot for your help. The palette is working now. Unfortunately
>> I have now a large color palette on the right side of my plot. How
>> can
>> I get rid of it?
>>
>
> 'unset colorbox'
> see
> http://www.gnuplot.info/docs/node167.html
>
>
> joachim heintz wrote:
>>
>> And until now I couldn't find a way to show my first column as a
>> label. Something like 'set label $1' - but what is the correct syntax
>> for it?
>>
>
> to get a data value as a key - within one plot command - first do
> a dummy plot to get this data value into a variable, and then use
> this variable for the 'title' of the next plot:
>
> plot "myfile.txt" every ::1::1 using (my_key=sprintf("%d",$1),0/0):
> (0/0)
> notitle, \
> "" every ::1::1 using 3:2 with imp title my_key linecolor palette
> frac 0.0,
> \
> "" every ::1::1 using 6:5 with imp notitle palette frac 0.1, \
> ...
>
> to get this data value as a label is a little more complicated because
> you need to do a complete dummy plot (e.g. into a 'dumb' terminal),
> then define the label, and afterward do the real plot:
>
> set terminal push
> set terminal dumb
> plot "myfile.txt" every ::1::1 (my_key=sprintf("%d",$1),0/0):(0/0)
> set label 1 my_key at ...
> set terminal pop
> set output "output_filename"
> plot "myfile.txt" every ::1::1 using 3:2 with imp notitle linecolor
> palette
> frac 0.0, \
> "" every ::1::1 using 6:5 with imp notitle palette frac 0.1 notitle, \
> ...
>
>
> --
> View this message in context: http://www.nabble.com/Plot-questions-tp23464492p23631177.html
> Sent from the Gnuplot - User mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables
> unlimited royalty-free distribution of the report engine
> for externally facing server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Gnuplot-info mailing list
> Gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
|
|
From: Thomas S. <t.s...@fz...> - 2009-05-21 08:31:46
|
the caret is below the 1st 'y' of the 'title my_key', isn't it?
i can reproduce this behaviour here with gnuplot 4.2.
sorry, i forgot to mention, you need gnuplot 4.3-cvs. version
4.2 doesn't have those the operators '=' and ',' in expression
syntax. you need to upgrade to version 4.3.
joachim heintz wrote:
>
> Thanks. 'unset colorbox' does its job. But with you suggestion
> regarding getting a data value as a key I get the following:
>
> gnuplot> plot "/Joachim/ShellSkripte/00gnuplot/Ganze1_12pms.txt"
> every ::1::1 using (my_key=sprintf("%d",$1),0/0):(0/0) notitle, "/
> Joachim/ShellSkripte/00gnuplot/Ganze1_12pms.txt" every ::a::a using
> 3:2 with imp title my_key linecolor palette frac 0, "/Joachim/
> ShellSkripte/00gnuplot/Ganze1_12pms.txt" every ::a::a using 6:5 with
> imp title my_key linecolor palette frac .333333, "/Joachim/
> ShellSkripte/00gnuplot/Ganze1_12pms.txt" every ::a::a using 9:8 with
> imp title my_key linecolor palette frac .666666
>
> ^
> "/tmp/gnupl005512.txt", line 7: ')' expected
> (no newlines in the terminal output; just in this email)
>
> Am I doing something wrong? No idea which ')' I am missing.
>
> joachim
>
>
--
View this message in context: http://www.nabble.com/Plot-questions-tp23464492p23649589.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|
|
From: joachim h. <jh...@jo...> - 2009-05-21 14:57:06
|
I'm not sure how complicated it will be to upgrade to 4.3-cvs. I'm on
OSX and had some difficulties to install gnuplot. Compiling from
sources gave some errors I didn't understand, so I went to the
darwinports. This worked, but I'm not sure if I can install 4.3 via
Darwinports.
For the moment it would be sufficient to print my first column in the
Terminal window. Can I do this with gnuplot 4.2? I tried 'print $1'
but this doesn't work.
Thanks -
joachim
Am 21.05.2009 um 10:31 schrieb Thomas Sefzick:
>
> the caret is below the 1st 'y' of the 'title my_key', isn't it?
> i can reproduce this behaviour here with gnuplot 4.2.
>
> sorry, i forgot to mention, you need gnuplot 4.3-cvs. version
> 4.2 doesn't have those the operators '=' and ',' in expression
> syntax. you need to upgrade to version 4.3.
>
>
> joachim heintz wrote:
>>
>> Thanks. 'unset colorbox' does its job. But with you suggestion
>> regarding getting a data value as a key I get the following:
>>
>> gnuplot> plot "/Joachim/ShellSkripte/00gnuplot/Ganze1_12pms.txt"
>> every ::1::1 using (my_key=sprintf("%d",$1),0/0):(0/0) notitle, "/
>> Joachim/ShellSkripte/00gnuplot/Ganze1_12pms.txt" every ::a::a using
>> 3:2 with imp title my_key linecolor palette frac 0, "/Joachim/
>> ShellSkripte/00gnuplot/Ganze1_12pms.txt" every ::a::a using 6:5 with
>> imp title my_key linecolor palette frac .333333, "/Joachim/
>> ShellSkripte/00gnuplot/Ganze1_12pms.txt" every ::a::a using 9:8 with
>> imp title my_key linecolor palette frac .666666
>>
>> ^
>> "/tmp/gnupl005512.txt", line 7: ')' expected
>> (no newlines in the terminal output; just in this email)
>>
>> Am I doing something wrong? No idea which ')' I am missing.
>>
>> joachim
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Plot-questions-tp23464492p23649589.html
> Sent from the Gnuplot - User mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity
> professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp asthey present alongside digital heavyweights like
> Barbarian
> Group, R/GA, & Big Spaceship. http://www.creativitycat.com
> _______________________________________________
> Gnuplot-info mailing list
> Gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
|
|
From: Thomas S. <t.s...@fz...> - 2009-05-21 19:03:34
|
you could read in the 1st column on a per-line basis
using unix (do these exist on a mac?) commands:
s=system('head -n 1 datafilename | tail -n 1 | awk "{print \$1}"')
or
s=system('head -n 2 datafilename | tail -n 1 | awk "{print \$1}"')
you read up to the line you want to get the data from (head),
then you take the last line only (tail), and extract the 1st value (awk).
then you may use the variable 's' for setting a label
set label 1 s at .....
or setting the plot key
plot 'datafilename' using ... title s ...
joachim heintz wrote:
>
> I'm not sure how complicated it will be to upgrade to 4.3-cvs. I'm on
> OSX and had some difficulties to install gnuplot. Compiling from
> sources gave some errors I didn't understand, so I went to the
> darwinports. This worked, but I'm not sure if I can install 4.3 via
> Darwinports.
> For the moment it would be sufficient to print my first column in the
> Terminal window. Can I do this with gnuplot 4.2? I tried 'print $1'
> but this doesn't work.
> Thanks -
> joachim
>
--
View this message in context: http://www.nabble.com/Plot-questions-tp23464492p23658667.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|
|
From: joachim h. <jh...@jo...> - 2009-05-21 21:31:01
|
Yes, no problems with Unix commands on OSX. It was a bit complicated,
because I have the line number as a variable which is changing in a
reread loop after pausing a while. I got this with (the variable "a"
is the line number)
command = sprintf("head -n %d $myfile | awk '{print $1}'", a)
zeit = system(command)
Now I could say
print zeit
and the first column of the line is printed in the Terminal window.
When I tried to see this in the plot window with
set label 1 zeit at ...
or
plot ... title zeit
it prints indeed, but it doesn't overwrite the previous print when the
plot is reread. Instead it prints the values one under each other. I
don't know if this can be achieved?
Thanks again -
joachim
Am 21.05.2009 um 21:03 schrieb Thomas Sefzick:
>
> you could read in the 1st column on a per-line basis
> using unix (do these exist on a mac?) commands:
>
> s=system('head -n 1 datafilename | tail -n 1 | awk "{print \$1}"')
> or
> s=system('head -n 2 datafilename | tail -n 1 | awk "{print \$1}"')
>
> you read up to the line you want to get the data from (head),
> then you take the last line only (tail), and extract the 1st value
> (awk).
>
> then you may use the variable 's' for setting a label
> set label 1 s at .....
> or setting the plot key
> plot 'datafilename' using ... title s ...
>
>
> joachim heintz wrote:
>>
>> I'm not sure how complicated it will be to upgrade to 4.3-cvs. I'm on
>> OSX and had some difficulties to install gnuplot. Compiling from
>> sources gave some errors I didn't understand, so I went to the
>> darwinports. This worked, but I'm not sure if I can install 4.3 via
>> Darwinports.
>> For the moment it would be sufficient to print my first column in the
>> Terminal window. Can I do this with gnuplot 4.2? I tried 'print $1'
>> but this doesn't work.
>> Thanks -
>> joachim
>>
>
> --
> View this message in context: http://www.nabble.com/Plot-questions-tp23464492p23658667.html
> Sent from the Gnuplot - User mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity
> professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, &
> iPhoneDevCamp asthey present alongside digital heavyweights like
> Barbarian
> Group, R/GA, & Big Spaceship. http://www.creativitycat.com
> _______________________________________________
> Gnuplot-info mailing list
> Gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
|