Hi,
I propose a clip/noclip property for objects.
I had the problem, that I wanted to mark something with a circle on the plot boundary. Especially for automatically calulated borders it was best to specify the circle center in graph/plot coordinates. But with this coordinate types, the circle is clipped to the plot boundaries.
The attached patch is a first proposal, which introduces two new keywords for objects:
You can test with the following example (needs the patch from https://sourceforge.net/p/gnuplot/bugs/1255/):
reset
set xrange[-1:1]
set yrange[-1:1]
set macros
fs="fillstyle solid 1.0 border lc rgb 'black' lw 2"
set lmargin at screen 0.2
set rmargin at screen 0.8
set tmargin at screen 0.8
set bmargin at screen 0.2
set object 1 rectangle from first -1.1,first -1.1 \
to first -0.5, first -0.5
set object 1 fc rgb 'red' @fs
set object 2 circle at graph 0, graph 0.5 radius graph 0.1
set object 2 fc rgb 'green' @fs
set object 3 polygon from first -0.5, first 0.5 \
to first 0, first 1.2 \
to first 0.5,first 0.5
set object 3 fc rgb 'yellow' @fs
set object 4 ellipse at graph 1,graph 0 size first 0.3, first 0.4
set object 4 fc rgb '#8888ff' @fs
plot 0
pause -1
The plot styles 'with circles' and 'with ellipses' are not affected.
Instead of having only these two options I would prefer having an additional possibility to clip to the plot boundary regardless of the coordinate type. (options 'clip', 'noclip', 'autoclip'?).
Looking forward to your comments,
Christoph
I reworked the object clipping:
clipdefault,clipandnoclipforset object circle,rectangle,polygon, andellipse.clipdefaultclips the objects based on the coordinate types (this is the default and corresponds to the current implementation).clipclips the objects at the plot boundaries.noclipdisables clipping.clipandnoclipfor plotting styleswith circlesandwith ellipseswhich can be set usingset style circleandset style ellipse.Added to cvs for 4.7, but with only a placeholder for the "always clip" option.
I am failing to see when this would ever be needed. Can you give an example?
I don't have a special use case, but I always found it kind of unintuitive to have the clipping depend on the coordinate type.
I guess it makes sense to have it, but often I prefer to set
clipwithout worrying about the coordinate type.