[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info
Subject:    Re: Inline multi y-axes problem *and* Multi "using" with '-'
From:       "Dick Crawford" <crawford () arete ! com>
Date:       1999-10-27 16:04:16
[Download RAW message or body]

On Tuesday, October 26, 1999 Robert M. Craver II <rob.craver@noaa.gov>


>I am trying to print (via perl filehandle) the results of a database query
>inline into gnuplot using multiple y-axes'.  The syntax I'm using is
similar
>to this: ...plot '-' using 1:3 axes x1y1, '' using 1:4 axes x1y2.  When I
>perform the same thing on a flat file it works fine.  Does gnuplot have to
>re-read the entire data set in order to plot the second axis, thusly
>requiring me to either save the data to a temporary file or requery the
>database?


and on Wednesday, October 27, 1999 Daniel Ajoy <dajoy@hoy.net> wrote:

>I tried this:
>
>plot \
>'-' using 0:1 axis x1y1 title "Y1.mn" , \
>'-' using 0:5 axis x1y1 title "Y1.SECEXD" , \
>'-' using 0:6 axis x1y1 title "Y1.CONTIG" , \
>'-' using 0:9 axis x1y2 title "Y2.CRUCES" , \
>'-' using 0:10 axis x1y2 title "Y2.JORFIT"
>1098 1432.53 1020.91 50 0 11 18 157 198 362 5
>1092 1424.79 1010.17 50 0 10 16 158 197 373 5
>1092 1408.68 1005.76 50 0 10 16 158 197 373 5
>1092 1395.53 1003.47 50 0 10 16 158 197 373 5
>1082 1385.38 999.419 50 1 14 22 151 180 343 4
>1074 1384.77 981.193 50 1 13 20 149 188 349 4
>1030 1379.69 970.305 50 1 10 22 139 178 361 2
>1012 1379.33 954.152 50 0 10 22 133 174 350 3
>1012 1366.61 951.832 50 0 10 22 133 174 350 3
>e
>
>And it didn't work. Is there a way I can change
>the plot statement to avoid repeating the data
>five times?

When gnuplot reads data from a multi-column file (either a normal file or
the special file "-"), it ignores the data in unused columns.  So there's no
reason at all to put multi-column data into "-".  (This is from the gnuplot
point of view -- I realize that the data may be generated in multi-column
form by some other process.)  Furthermore the data in "-" are essentially
discarded after they have been plotted once, so even something like "plot
'-', '-' " requires that the data appear twice.

So the answer to both questions is:  You have two choices.  You can write
the data to an external file and read it multiple times, or you can repeat
the data set in-line the requisite number of times.

Dick Crawford, aka crawford@arete.com

 - -
[[[[ to unsubscribe from info-gnuplot, send an email with body
unsubscribe info-gnuplot
to majordomo@dartmouth.edu
]]]]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic