using multiplot

using multiplot

Post by Bob Hackenber » Mon, 29 Nov 1999 04:00:00



I am attempting to plot wind speed along the y1 axis and
temperature along the y2 axis.  The x axis is time/date.

My code is the following:

set output 'chwx.gif'
set terminal gif
set noborder
set nokey
set ytics nomirror
set rmargin 5
set xdata time
set timefmt "%m/%d/%y %H:%M"
set size 1,.8
set autoscale y
set format x "%H\n%m/%d"
set xrange ["11/25/99 00:00":"11/27/99 23:59"]
set timestamp
set multiplot
plot 'data.txt'  using 1:4 axes x1y1 with lines
set noytics
set y2tics nomirror
set noxtics
set nox2tics
set title  "Wind and Temperature"
plot 'knight_data.txt'  using 1:3 axes x1y2 with lines lt 2

Each batch of data seems to be plotted against the y-scale
that is requested (wind goes from 0-18 and temperature from
50-70.  However, the problem is that the second plot is not
placed correctly.  It is a bit down and to the left of the
first plot.  I want the ploting area overlayed perfectly.
Any idea of what I am doing wrong.

thanks,

bob

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful

 
 
 

using multiplot

Post by Marco Wehofsk » Tue, 30 Nov 1999 04:00:00


Hi Bob,

Bob Hackenberg schrieb:

Quote:> I am attempting to plot wind speed along the y1 axis and
> temperature along the y2 axis.  The x axis is time/date.

> My code is the following:

> set output 'chwx.gif'
> set terminal gif
> set noborder
> set nokey
> set ytics nomirror
> set rmargin 5
> set xdata time
> set timefmt "%m/%d/%y %H:%M"
> set size 1,.8
> set autoscale y
> set format x "%H\n%m/%d"
> set xrange ["11/25/99 00:00":"11/27/99 23:59"]
> set timestamp
> set multiplot
> plot 'data.txt'  using 1:4 axes x1y1 with lines
> set noytics
> set y2tics nomirror
> set noxtics
> set nox2tics
> set title  "Wind and Temperature"
> plot 'knight_data.txt'  using 1:3 axes x1y2 with lines lt 2

> Each batch of data seems to be plotted against the y-scale
> that is requested (wind goes from 0-18 and temperature from
> 50-70.  However, the problem is that the second plot is not
> placed correctly.  It is a bit down and to the left of the
> first plot.  I want the ploting area overlayed perfectly.
> Any idea of what I am doing wrong.

You don't have to use multiplot for this. If you define two axes like you have done you can place both plot in one command like

... as you defined ...
set timestamp
# set multiplot
# plot 'data.txt'  using 1:4 axes x1y1 with lines
set title  "Wind and Temperature"

plot 'knight_data.txt'  using 1:3 axes x1y2 with lines lt 2, 'data.txt'  using 1:4 axes x1y1 with lines

this plots knight_data.txt on the second y-axis over the x-axis and 'data.txt' on the first y-axis also over the x-axis.

multiplot is mainly useful, when you for example want to plot both datafiles in two single boxes. Then you have to use the origin command to place the plots
on the page.

 
 
 

using multiplot

Post by Marco Wehofsk » Tue, 30 Nov 1999 04:00:00


Hi Bob,

Bob Hackenberg schrieb:

Quote:> I am attempting to plot wind speed along the y1 axis and
> temperature along the y2 axis.  The x axis is time/date.

> My code is the following:

> set output 'chwx.gif'
> set terminal gif
> set noborder
> set nokey
> set ytics nomirror
> set rmargin 5
> set xdata time
> set timefmt "%m/%d/%y %H:%M"
> set size 1,.8
> set autoscale y
> set format x "%H\n%m/%d"
> set xrange ["11/25/99 00:00":"11/27/99 23:59"]
> set timestamp
> set multiplot
> plot 'data.txt'  using 1:4 axes x1y1 with lines
> set noytics
> set y2tics nomirror
> set noxtics
> set nox2tics
> set title  "Wind and Temperature"
> plot 'knight_data.txt'  using 1:3 axes x1y2 with lines lt 2

> Each batch of data seems to be plotted against the y-scale
> that is requested (wind goes from 0-18 and temperature from
> 50-70.  However, the problem is that the second plot is not
> placed correctly.  It is a bit down and to the left of the
> first plot.  I want the ploting area overlayed perfectly.
> Any idea of what I am doing wrong.

You don't have to use multiplot for this. If you define two axes like you have done you can place both plot in one command like

... as you defined ...
set timestamp
# set multiplot
# plot 'data.txt'  using 1:4 axes x1y1 with lines
set title  "Wind and Temperature"

plot 'knight_data.txt'  using 1:3 axes x1y2 with lines lt 2, 'data.txt'  using 1:4 axes x1y1 with lines

this plots knight_data.txt on the second y-axis over the x-axis and 'data.txt' on the first y-axis also over the x-axis.

multiplot is mainly useful, when you for example want to plot both datafiles in two single boxes. Then you have to use the origin command to place the plots
on the page.

Marco Wehofsky

 
 
 

using multiplot

Post by Bob Hackenber » Tue, 30 Nov 1999 04:00:00


Thanks for the reply.  I have been able to plot both
together with a single call to plot as you say.  The result
however, is that the two plots are on the same scale.
Because the windspeed tends to be a relatively low number
and temperature in F in fairly high numbers, the wind looks
insignificant.  This would be even worse if I plotted
temperature against barometric pressure because pressure has
a very small numeric range.  What multiplot should let me do
is have both plots laid directly on top of reach other.  You
interpret one plot by reading the y1 labels and the other by
reading the y2 labels.

I played around a little bit with a different 'set origin'
and that seems to be the secret although it still leaves an
imperfect match.  What I am experiencing is that the second
plot seems to be a little wider in the plot box than the
first one.  I then tried to make the secong graph slightly
smaller than the first.  That whole approach seems wrong,
however. You would think that if you kept everything the
same, gnuplot would line everything up in the plot area by
default.

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful

 
 
 

using multiplot

Post by t.sefz.. » Tue, 30 Nov 1999 04:00:00



Quote:> Subject: Re: using multiplot
> Thanks for the reply.  I have been able to plot both
> together with a single call to plot as you say.  The result
> however, is that the two plots are on the same scale.
> Because the windspeed tends to be a relatively low number
> and temperature in F in fairly high numbers, the wind looks
> insignificant.  This would be even worse if I plotted
> temperature against barometric pressure because pressure has
> a very small numeric range.  What multiplot should let me do
> is have both plots laid directly on top of reach other.  You
> interpret one plot by reading the y1 labels and the other by
> reading the y2 labels.

> I played around a little bit with a different 'set origin'
> and that seems to be the secret although it still leaves an
> imperfect match.  What I am experiencing is that the second
> plot seems to be a little wider in the plot box than the
> first one.  I then tried to make the secong graph slightly
> smaller than the first.  That whole approach seems wrong,
> however. You would think that if you kept everything the
> same, gnuplot would line everything up in the plot area by
> default.
>-- End of excerpt from Bob Hackenberg

hi,
you don't need to make things complicated and use multiplot, what you want can
be done with a simple plot command. try the following script:

set ytics nomirror
set y2tics
plot '-' using 1:2 axes x1y1 with lines, '-' using  1:2 axes x1y2 with lines
0. 1.
1. 2.
2. 1.
3. 2.
e
0. 11.
1. 10.
2. 11.
3. 10.
e

it has different y-scales which fit to the data. if you need to adjust the
different y-ranges, use e.g. 'set yrange [0.5:2.5]' and 'set y2range [9.:12.]'
or whatever.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  _____ _   _  ___  __  __   _   ___
 |_   _| |_| |/ _ \|  \/  | / \ / __|    Thomas Sefzick
   |_|_|  _  | (_) | |\/| |/ A \\__ \    Forschungszentrum Juelich
  /|_|_|_| |_|\___/|_| _|_|_/-\_____/    D-52425 Juelich
 | (___  ____ _______  ___  ___ _  __    Germany
  \___ \| __/| __/_  /|_ _|/ __| |/ /    phone: +49-2461-61-4337
  ____) | _| | _| / /_ | || (__|   |       fax:            -3930

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 
 
 

using multiplot

Post by Dick Crawfor » Tue, 30 Nov 1999 04:00:00



>Thanks for the reply.  I have been able to plot both
>together with a single call to plot as you say.  The result
>however, is that the two plots are on the same scale.
>Because the windspeed tends to be a relatively low number
>and temperature in F in fairly high numbers, the wind looks
>insignificant.  This would be even worse if I plotted
>temperature against barometric pressure because pressure has
>a very small numeric range.  What multiplot should let me do
>is have both plots laid directly on top of reach other.  You
>interpret one plot by reading the y1 labels and the other by
>reading the y2 labels.

>I played around a little bit with a different 'set origin'
>and that seems to be the secret although it still leaves an
>imperfect match.  What I am experiencing is that the second
>plot seems to be a little wider in the plot box than the
>first one.  I then tried to make the secong graph slightly
>smaller than the first.  That whole approach seems wrong,
>however. You would think that if you kept everything the
>same, gnuplot would line everything up in the plot area by
>default.

The problem most likely is that the stuff in the margins (axis labels and
titles) isn't the same size for the two plots you're overlaying.  By
default, gnuplot will choose margins big enough to make everything fit.  You
can override this with "set lmargin" and/or "set rmargin", which should
solve the problem.

But the better solution is to simply use the multi-axis approach (not
multiplot) already mentioned.


 
 
 

using multiplot

Post by Bob Hackenber » Tue, 30 Nov 1999 04:00:00


Thanks for all the help.  I got it working with a multi-axis
plot.

The working code is:

set title "Cherry Hill, NJ Weather"
set ylabel "Wind speed in MPH"
set y2label "Inches of Mercury"
set ytics nomirror
set y2tics
set xdata time
set timefmt "%m/%d/%y %H:%M"
set format x "%H\n%m/%d"
set xrange ["11/25/99 00:00":"11/27/99 23:59"]
set timestamp "Generated: %d/%m/%y %H:%M"
plot 'knight_data.txt'  using 1:4 axes x1y1 t "Wind Speed"
with lines 4,\
    'knight_data.txt' using 1:6 axes x1y2 t "Barometric
Pressure" with lines 3

A sample of data:

11/24/99 07:56 56.5 7.5 S 30.25
11/24/99 08:10 56.5 0.0 S 30.27
11/24/99 08:20 56.5 0.4 WSW 30.27
11/24/99 08:35 56.5 0.0 SSE 30.27
11/24/99 08:46 56.5 0.0 S 30.26

If anyone wants to use the data that I collect, you can get
it at:

http://www.eticomm.net/~rhackenb/weather/knight_data.txt

This is updated every five minutes.  I keep the most recent
1000 data records in that file.  It is in space-delimited
format with fields for date, time, temperature, wind speed,
wind direction, and barometric pressure.

-- bob

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful

 
 
 

1. Two plots from on file using multiplot?

Hi all,
I would like to plot some data into two splots on one page.
The data for two the plots in contained in only one file
(and I would like to keep it there as it more convenient for me).
I tried the following:
set parametric
set nokey
set zrange [0:5]
set size 1.,1.
set origin 0,0
set multiplot
set size 1.,1.
set origin 0,0
set data styl line
set grid xtics ytics ztics
set border 127+256+512
set ztics border mirror
set title "Boltzmann-Verteilung, Gesamtenergie"
splot "-" using 1:3:2  '%lf %lf %lf'
set size .4,.4
set origin 0.,.5
set nohidden3d
set noautoscale x
set xrange [-0.01:0.01]
set border 256+32+16+2
set noxtics; set noytics
splot "-" using (0.):1:2  '%lf %lf %lf'  
0.115 0.000 43.51899
0.344 0.002 43.51899
0.573 0.004 43.51899
...     ...     ...

43.51899 2.46876
114.23026 2.25492
175.77397 2.23412
236.16966 2.23959
   ....      ...
end

However, I only get the first, not the second plot.
I am using gnuplot 3.6.
If I specify "" as the source for the second plot, it
does not work either.
I did look through the manual, but didn't find a hint
on how to achieve this.
Has anybody some suggestions?
Thanks in advance,
        Gerhard

2. Increase border width of DrawEdge

3. size in multiplot

4. OpenGL

5. many plots on same page (not multiplot)

6. Colours in eps files generated from Corel

7. Multiplot Background

8. Online Tutorials?

9. alignment of a plot/splot with multiplot

10. PM3D, multiplot, palettes and PNG

11. How to delete same label in multiplot

12. Multiplot

13. Answer without a question: multiplot