How to make a frame with border in gnuplot?

Viewed 2721

I am trying to make a frame for a density plot. I start with

set terminal pngcairo size 400,400 enhanced
set output 'test.png'

set view map
unset tics
unset colorbox
set size ratio 1

set border 15 front lw 20
#set border 15 back lw 20

splot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2) w pm3d notitle

enter image description here

If I use front the border looks continuous, but it eats a portion of the plot. If I use back, it no longer looks like a frame.

How can I make a proper frame such that it stays out of the plot region?

1 Answers

Using the square option for the line endings of the pngcairo terminal might help:

set terminal pngcairo size 400,400 enhanced square
set output 'test.png'

set view map
unset tics
unset colorbox
set size ratio 1

set border 15 back lw 20

splot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2) w pm3d notitle

This produces:

enter image description here

One might also want to slightly increase the isosamples, e.g., set isosamples 100 to get a smoother plot:

enter image description here

Related