JuliaPlots / Plots.jl

Powerful convenience for Julia visualizations and data analysis
https://docs.juliaplots.org
Other
1.84k stars 354 forks source link

Draw closed hollow shapes #972

Open heliosdrm opened 7 years ago

heliosdrm commented 7 years ago

Hi. It's cool to create custom shapes (Shape objects) with Plots, which can be used to draw creative figures (like the Batman example in ExamplePlots), or as new markers, for instance. I would like to know if there is some way to create such shapes with "holes", e.g. a ring, which would be like two concentric circles, but with the smaller one "removing" part of the filled area.

mkborregaard commented 7 years ago

There isn't unfortunately - I think most of the backends don't support it. It'd be really great to have though, as this would be useful e.g. for plotting geographic shapefiles.

pazner commented 3 years ago

Apologies for bumping an old issue. This would be useful for me: I have a package that provides recipes for plotting contours on unstructured triangular meshes. The filled contour regions are computed, but I don't think I can draw them with Plots.jl without this feature (the regions may contain holes).

With GR, it's actually quite easy to draw regions with holes like these (GR uses an even-odd rule, delimited with NaNs), see for example here. I'm not sure about other backends.