## Plotting multiple elements on one graph?

### Plotting multiple elements on one graph?

I'm trying to plot photon path traversals around probabilisitic
singularity regions. The trick is, I need to be able to place all on
the same graph.

What I'd like gnuplot to do is:
1) plot the dozen or so singularity regions, with color 1
2) plot the single photon path traversal, with color 2
...all on the same graph / grid space.

Also if possible, I'd also like to draw a boundary around the
collection of points defining each of the singularity regions, and
fill each in with a certain color.

I've looked at the 'multiplot' command. However, it doesn't seem to
allow me to overlay the plots on top of each other. And I don't see
how to draw the singularity boundary regions, nor fill them in with a
particular color.

Alex

### Plotting multiple elements on one graph?

On 26 Jun 2003 10:48:25 -0700, Alex Majora scribbled:
: I'm trying to plot photon path traversals around probabilisitic
: singularity regions. The trick is, I need to be able to place all on
: the same graph.

: What I'd like gnuplot to do is:
:   1) plot the dozen or so singularity regions, with color 1
:   2) plot the single photon path traversal, with color 2
: ...all on the same graph / grid space.

: Also if possible, I'd also like to draw a boundary around the
: collection of points defining each of the singularity regions, and
: fill each in with a certain color.

: I've looked at the 'multiplot' command. However, it doesn't seem to
: allow me to overlay the plots on top of each other. And I don't see
: how to draw the singularity boundary regions, nor fill them in with a
: particular color.

`set multiplot` can be (ab)used to do what you want, by disabling all
automatic scaling and sizing. That said, why would something like
plot 'dataset1', 'dataset2', f3(x)
be unsatisfactory for you? See the examples in `help plot`.

The `filledcurves` plotting style available in the development version
may do what you want for filling in a region. Post-processing (either
manual, using a drawing program like xfig, or automatic (see the links at
www.gnuplot.info)) can do this as well, if you don't have access to the
development version. You're on your own for calculating the boundaries,
though, if I understand correctly what you're asking.

THeo

### Plotting multiple elements on one graph?

>   1) plot the dozen or so singularity regions, with color 1

How do you intend to display such a region?  gnuplot only plots lines
in its release version, so it could only show the boundaries of such
regions...

Quote:>   2) plot the single photon path traversal, with color 2

That one should be simple.

Quote:> ...all on the same graph / grid space.

... and this, too.  You don't even need multiplot to do it.  Just list
several plottable datasets in a single 'plot' command.

Quote:> Also if possible, I'd also like to draw a boundary around the
> collection of points defining each of the singularity regions, and
> fill each in with a certain color.

Finding that boundary cannot be the task of gnuplot --- that's up to
you.  Filling it in can't be done with the release version.  There
'with filledcurves' in the development version, but that's still
a rather experimental feature.

--

Even if all the snow were burnt, ashes would remain.

### Plotting multiple elements on one graph?

> How do you intend to display such a region?  gnuplot only plots lines
> in its release version, so it could only show the boundaries of such
> regions...

Yes, simple boundaries will suffice. Is there a gnuplot way to bound
all points of a data set?

> That said, why would something like plot 'dataset1', 'dataset2', f3(x)
> be unsatisfactory for you?

I am concerned primarily about exceeding the command line limit?
Placing all plotting information for each data set into one 'plot'
command will stretch out to 1024 characters or so. Is there a limit?
Being able to issue successive 'plot' commands would be easier to
manage -- but I'm happy just to have a way that works!

Also, is there a way to have gnuplot display the coordinate grid space
in the graph? I know it allows you to have tick marks on the axes; can
it also draw the background grid? (I didn't see this in the FAQ.)

Thanks, Hans and Theo for your informative help and patience with a
gnuplot beginner. With what you've told me, I can get very far towards
what I'm trying to do.

Alex

### Plotting multiple elements on one graph?

>> How do you intend to display such a region?  gnuplot only plots lines
>> in its release version, so it could only show the boundaries of such
>> regions...
> Yes, simple boundaries will suffice. Is there a gnuplot way to bound
> all points of a data set?

No.  That would have to be done by your own data analysis routine(s).
gnuplot is not a tool for numerical nor graphical analysis, by design.

Quote:> I am concerned primarily about exceeding the command line limit?
> Placing all plotting information for each data set into one 'plot'
> command will stretch out to 1024 characters or so. Is there a limit?

No.  The internal buffer auto-expands if necessary.

Quote:> Also, is there a way to have gnuplot display the coordinate grid space
> in the graph? I know it allows you to have tick marks on the axes; can
> it also draw the background grid? (I didn't see this in the FAQ.)

set grid

(unsurprisingly) does that.

--

Even if all the snow were burnt, ashes would remain.

Dear Gnuplot users

Hi, I am new to Gnuplot. Sorry, if this question is very basic. I have multiple data set as shown below;

Crossection # 1 at Chainage 200
x= 0.000000  y=29.889000 x= 0.000000  y=29.889000
xl= -4.415000 yl= 32.048000 xr=4.435000 yr=32.223000
xl= -7.742000 yl= 34.627998 xr=7.462000 yr=34.772999
xl= -13.294000 yl= 37.702999 xr=12.367000 yr=37.522999
xl= -14.055000 yl= 37.608002 xr=13.885000 yr=37.563000

Crossection # 2 at Chainage 400
x= 0.000000  y=29.889000 x= 0.000000  y=29.889000
xl= -2.599000 yl= 30.469999 xr=2.150000 yr=29.982000
xl= -5.717000 yl= 31.392000 xr=6.683000 yr=30.402000
xl= -10.227000 yl= 34.152000 xr=8.963000 yr=33.062000
xl= -10.227000 yl= 34.152000 xr=9.021000 yr=33.266998
xl= -10.227000 yl= 34.152000 xr=9.655000 yr=33.722000

I would like to write a script that would take the first line as the title of the graph and the following data as points on a graph. The second data set is seperated by the null lines. How can I view the plotted graph each at a time. The script I wrote will put both data sets on one graph. I tried to use pause -1 but it didn't work. Can anyone help me solve these problems
1) to automatically read charaters from my data file and set it as title, and
2) to plot seperate graphs from seperate data sets, and to view the graphs one at each time.