Search code examples
gnuplot

multiplot of isolines and points creates two axis frames


I've created a multiplot containing an isoline plot f(x,y) and a point, (0,0) on the zero level set of the isoline plot. Unfortunately the point plot appears to create a second axis frames as shown below

f(x,y)=2*x**2 - x + 2*y**2 - y - 2
set multiplot
set xrange [-3:3]
set yrange [-3:3]
set isosamples 250
set contour
unset surface
set view map
set key out
set cntrparam levels incremental  0,1,5
splot f(x,y)
plot "< echo '1 1'"
set nomultiplot

What can I do to solve this problem?

Update

A bit more context. In the larger problem I am using multiplot to superimpose two isoline plots, as hinted below. Both isoline plots share a common axis frame.

...
set cntrparam levels incremental  0,1,5
splot f(x,y)
set cntrparam levels discrete 0
g(x,y)=(x - 1)**2 + y**2 - 1
splot g(x,y)

isoline plot and single point


Solution

  • Unless there are additional requirements that mandate use of multiplot, the simplest solution is to draw your single point as a label instead. The label comes with a point for free. You only want the point, so the label text is an empty string.

    If this was a proxy question for a more complicated requirement, please edit the question to give more detail.

    f(x,y)=2*x**2 - x + 2*y**2 - y - 2
    
    set label 1 "" at 1,1,0 point pt 7 lc "blue"
    
    set xrange [-3:3]
    set yrange [-3:3]
    set isosamples 250
    set contour
    unset surface
    set view map
    set key out
    set cntrparam levels incremental  0,1,5
    splot f(x,y) with lines
    

    enter image description here

    Edit The multiplot version:

    f(x,y)=2*x**2 - x + 2*y**2 - y - 2
    g(x,y)=(x - 1)**2 + y**2 - 1
    
    set label 1 "" at 1,1,0 point pt 7 lc "blue"
    
    set xrange [-3:3]
    set yrange [-3:3]
    set isosamples 250
    set contour
    unset surface
    set view map
    
    set multiplot
    
    set cntrparam levels incremental  0,1,5
    set key out top
    splot f(x,y) with lines
    
    set cntrparam levels discrete  0
    set key out bottom
    splot g(x,y) with lines
    
    unset multiplot
    

    enter image description here