fastest
fastest

Reputation: 177

gnuplot: plotting single palette in multiplot mode

I would like to ask some help on the following topic:

The following code produces 3 plots (3 rows, 1 column) on the same page:

set terminal postscript color
set output "test.ps"
file="test.dat"

set palette rgb 33,13,10  
set cblabel "[km]"
set cbtics 2.5, 5, 20 format "%.0f"

set lmargin at screen 0.08
set rmargin at screen 0.88
# BUILD FROM BOTTOM TO TOP #
TOP=0.92  #
DY = 0.27 # DIMENSION OF Y

set multiplot
set grid
set offset 0, 0, graph 0.05, graph 0.05 

#unset colorbox
# BOTTOM GRAPH #
set xlabel "Second of the Week [s]"
set ylabel "Up [m]" offset 1.5
set ytics -0.7, 0.2, 0.4
set yrange[-0.75:0.35]
set tmargin at screen TOP-2*DY
set bmargin at screen TOP-3*DY
plot file u 1:12:3 notitle palette 
# MIDDLE GRAPH #
set xtics format ''
unset xlabel 
set ytics -0.3, 0.2, 0.8
set yrange[-0.35:0.75]
set ylabel "North [m]"
set tmargin at screen TOP-DY
set bmargin at screen TOP-2*DY
plot file u 1:11:3 notitle palette
# TOP GRAPH #
set title "test"
set ylabel "East [m]"
set ytics -0.7, 0.2, 0.4
set yrange[-0.9:0.25]
set tmargin at screen TOP
set bmargin at screen TOP-DY
plot file u 1:10:3 notitle palette

unset multiplot

The above code produces the following plot:

color coded measurements

In the plots, the data are shown according to the distance from an origin. The distance is color coded and the palette used is plotted on the right of each graph.

My question would be: - how do I obtain the same graph but with a single vertical palette on the right of the 3 plots? I want a single palette to be shown from the top of the first graph (East) to the bottom of the third graph (Up). This would allow me to enlarge the palette as well and would result in a cleaner plot.

Any help is greatly appreciated.

Upvotes: 4

Views: 2376

Answers (1)

Gavin Portwood
Gavin Portwood

Reputation: 1217

For the first one use

set colorbox user origin screen 0, screen 0.05 size screen XX, screen YY

Where you need to set XX and YY to fit the desired colorbox width and heigh of the three plots.

Then for the second two plots, just set

unset colorbox

Upvotes: 5

Related Questions