MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.38k stars 302 forks source link

`clip_on` kwarg like in matplotlib to avoid cutting off points at boundary #1322

Open SimonEnsemble opened 2 years ago

SimonEnsemble commented 2 years ago

clip_on kwarg would be cool to still show the entirety of the markers from scatter after xlims!(ax, [0, 1]). see boundaries on left and right how two points are cut in half.

image

jkrumbiegel commented 2 years ago

Currently, clipping is done on scene level, so every plot inside a scene is clipped at the px_area rectangle. Either this would have to be made toggleable on plot object level (participate in clipping or not) or better yet, every plot should optionally have its own clipping area. This would be needed for triangular shapes for ternary plots for example, or more complex polygons for geographic plots with round frames. In CairoMakie, it would be trivial to implement, but I'm not sure at all how clipping in GLMakie works.

SimonEnsemble commented 1 year ago

we have another use case where clip_on is needed.

seems important for ylims!(0, nothing) but that cuts the points in half... any way to draw the points over the axis?

Screenshot 2023-04-20 at 5 57 31 PM
jkrumbiegel commented 1 year ago

There's no way to do that currently. In principle it would be possible to disable clipping to the scene px_area. I would actually like to see arbitrary clipping shapes for polar plots and such.

ffreyer commented 3 weeks ago

I set up clip planes to clip scatter markers when their coordinate gets clipped rather than their pixels. So we could use those to avoid cutting off markers