Search code examples
gnuplotclip

Gnuplot won't clip my circle plot. Does set clip works?


I am trying to plot a "fat bands" bandstructure and I am having some trouble with gnuplot.

set terminal pngcairo size 1600,1200 enhanced font "Verdana, 40"  
set output 'bandplot.png' 

set ylabel 'Energy (eV)' 
set yrange [-3:3]                # set x range of the plot 
set border lw 4 
set key  font ",25" spacing 1.0 samplen 0 at screen 0.55,0.8
set clip
plot 'bands.dat' u ($1):($2) with lines lt -1 lw 5 notitle,\
 'bands.dat' u ($1):($2):(0.0015*$3) with circles lc rgb "blue"   fs transparent solid 0.25 noborder title "test"

This data is basically a function in black line and over that there is a similar data with variable sized circles. The thing is set clip is not avoiding some of the circles to be drawn outside the graph. Does anyone know how to do it?

Also, I have seen some bug pages and this might not be possible to be accomplished. Thanks!


Solution

  • Works fine for me even without using set clip (tested with 5.0 and 4.6.6):

    set xrange [-pi:pi]
    set samples 21
    plot '+' using 1:(cos($1)):(0.1) with circles fs solid
    

    enter image description here