sciapp / gr

GR framework: a graphics library for visualisation applications
Other
328 stars 54 forks source link

Purpose of MAX_CLIP in svgplugin.c? #106

Closed HozzaH closed 4 years ago

HozzaH commented 4 years ago

Hi,

I'd be interested to know why there's a limit on the number of clipPath elements for SVG output (MAX_CLIP in svgplugin.c).

I've had problems with this when using gr via StatsPlots.jl, specifically with the cornerplot function. For a 16 parameter plot 150 subplots are produced and 152 clipPaths are needed, with the standard setting of MAX_CLIP=64 a plot is produced, but together with a large number of GKS error messages. If I recompile gr with a higher value of MAX_CLIP the plot is produced without errors.

Thanks

jheinen commented 4 years ago

Thanks for the hint. Could you please provide a MWE?

HozzaH commented 4 years ago

Using Julia in Jupyter its quite simple:

using StatsPlots
M = randn(10,16);
cornerplot(M, compact=true,size=[2000,2000])
# Output to file if needed
savefig("GRStandardLimTest.svg")

I've included 2 examples of the output of this in the attached zip, one with the MAX_CLIP=64 (Standard) and another with MAX_CLIP=6400 (Large)

GRLimTest.zip

jheinen commented 4 years ago

This problem is fixed in the development branch (f666ae64c008f6dbcf056b6ae615fdfd64b20c0c) in will be merged soon.

IngoMeyer441 commented 4 years ago

The patch is now included in the latest stable release (v0.49.0), so this issue can be closed.