-
-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incosistency of image size across different backends (GR != others) #1355
Comments
@juliohm Does it help if you add |
@daschw it does. Tests pass if I create this environment variable in |
In #1318 the image size of pngs has been increased by a factor of 6 for GR in order to produce higher quality files with savefig. This would however significantly increase the size of the PlotReferenceImages repo so @jheinen introduced the |
Does it mean that GR will by default create png images that are much larger than the other backends? I am trying to understand the consistency of the framework. I am guessing that as before if we do |
Thank you for your work @daschw, the time you put to Plots.jl is very valuable to the community. I hope these inconsistencies will go away with time. If not here, Makie.jl will hopefully fix them. |
I still don't understand, why changing the DPI setting in Plots also changes the visual appearance. In GR you can set the display size using metric limits - for image-like displays, you will have to inquire the display units first and then use a corresponding range. All sizes in GR are device-independent: line-widths, marker sizes, text heights. For the latter, you can exactly specify the size of the character boxes. This even works in GUIs (like Qt) or if you use different displays on a single computer. If it's really "made by design", that increasing the DPI settings will decrease character heights, marker sizes, etc, I will see how this can be implemented in the GR backend within Plots. I don't want GR to be inconsistent, but I can't change this behaviour in GR as it conforms to the GKS standard. |
Thank you for the clarifications @jheinen, it is great to learn how GR is well-designed, my favorite backend. ❤️ I hope this fix you have in mind within Plots.jl is implemented soon. I've added |
Here's what I wrote in slack about the DPI and visual appearance: FWIW I disagree with @jheinen on this, though it depends a little how you define “resolution”. Normally “resolution” is the relationship between the physical size of a plot, and the number of pixels it contains. But plots don’t have a physical size before printing them (well to be pedantic they have the size of the screen in which case resolution is usually considered 72 dpi). The size of a plot on the screen is instead only given in pixels. So the question is: should the size, in pixels, of elements (line thickness, axis font, tick font, marker sizes etc) be constant (the way it is done in Plots, and almost any other plotting package I know) or scale as a constant fraction of the plot size (the way it is done in GR). To understand the difference, consider the easiest way to change the size of a plot: resizing the plot window by dragging in the corner. With the newest terminal, this is now also possible in GR. Given the common constant-size-elements implementation, this will change how the plot looks, the aspect ratio, the size of the markers with respect to the plot area etc. With GR’s scaling-elements implementation, you will have the exact same plot - it will just get bigger and smaller on your screen. Here’s why I like the constant-size-elements: it’s the easiest and most intuitive way to get the plot to look exactly as you want it to, because you can visually change the plot by interactively resizing, instead of having to change the size of axis fonts, lines etc programmatically and iteratively for every element. Then there’s the second element - the resolution of finished plots, once you save them to a file. For printing this resolution will often need to be much larger than screen resolution, meaning that plots that look good on a screen at 72 dpi will become very small once it’s printed at 600 dpi. So what is needed is something to increase the actual resolution without changing the appearance of the plot, but I don’t think the best way is to use the plot’s Instead what I suggest is to have a Having interactive resizing, and a separate constant-scaling |
Fixed by #1561 |
Issue originally reported in JuliaPlots/VisualRegressionTests.jl#10
After triage, we confirmed the issue is GR-specific.
According to @daschw, the issue may be related to #1318.
cc: @jheinen
The text was updated successfully, but these errors were encountered: