update 2003/10/16
BACK: UP: NEXT: JAPANESE:

About 2-Dimensional Plot (No.5)

A small figure in a figure

Making a small figure inside a figure. Sometimes you may see a magnified plot in a margin to make a crowded part clear. To put such a magnified window, use multiplot. We make about 1/4 of the full-size figure inside the main plot. Firstly draw a main graph in the multiplot mode.

gnuplot> set xrange [ 0 : 20 ]
gnuplot> set yrange [ 0 : 6 ]
gnuplot> set xtics 5
gnuplot> set ytics 1
gnuplot> set multiplot
multiplot> set origin 0.0,0.0
multiplot> set size 1.0,1.0
multiplot> plot "file.dat" u 1:2:3 notitle with yerrorbars,\
>               "file.cal" u 1:2   notitle with lines

Move the origin to the vacant place (0.45,0.1), and draw a small graph there. The X and Y ranges should be determined to enlarge the place where you want to magnify. The small figure is the same as the main one except for the ranges, so that you can use the replot command.

multiplot> set origin 0.45,0.1
multiplot> set size 0.5,0.5
multiplot> set xrange [ 1 : 5 ]
multiplot> set yrange [ 2.4 : 3.0 ]
multiplot> set ytics 0.5
multiplot> replot
multiplot> set nomultiplot
gnuplot>
fig/sample5.14

Now you can see clearly the part where there exists many data points. We chose the origin and size so as not to overlap those two figures. It is impossible to erase lines and points of the main figure which intrude the small one with gnuplot.

X and Y axis names for the small graph should be empty, even the main figure has those stuff. When you want to make a reduced size EPS, the set size command should be outside the multiplot mode. Otherwise gnuplot defines BoundingBox in your Postscript file so as to include a whole screen. You can see an example in our gallery.



A simple bar-chart

Gnuplot draws open rectangulars when with boxes is used to make a bar-chart, as you can see an example. There are some tools those convert your open boxes into filled ones. You can find them at Gnuplot Central.

If you are making a Postscript figure, the easiest way is to draw a figure with impluses with very thick lines. In the next example we defined the line type 1 which is 50 times thicker than the default width.

gnuplot> set term postscript eps enhanced color
gnuplot> set linestyle 1 lt 1 lw 50
gnuplot> plot "test.dat" using 1:2 with imp ls 1
fig/sample5.15
BACK: UP: NEXT: JAPANESE: