pyplot as plt import numpy as np import pandas as pd from io import StringIO import re inp = StringIO( '''Screen Resolution,Sessions,% New Sessions,New Users,Bounce Rate,Pages / Session,Avg. gives screen resolution statistics for the general web user. When we reduced the figure size in inches to restore it's size in pixels, we increased the font size relative to the figure size, thus we need to shrink the font a bit to get back to the previous ratio. Once the image gets embedded in something else it almost always get scaled uniformly (ex a figure that fills a slide in a presentation) so the font size in the figure is not strictly related to the font size in the rest of the document. When thinking about font sizes what really ends up mattering is the ratio between the font height (in pixels) and the figure height (in pixels). I think reducing the font size is the right thing to do. Currently our default figure size and dpi ((6.4, 4.8), 100) gives 640x480 which is sort of close (it is the difference between a 4:3 and 5:3 aspect ratio) but is enough that only ~50% of our users can tile 2 figures vertically (and that is not considering the GUI/window manager space). If we say a figure should take up no more that 1/4 of the screen by default, then our target resolution should be 640x384. If we assume 1280x768 that as a screen size that catches 94.8% of our user base. This is based on data from Mach 2015 till now. We nominally have some data about this from the analytic on the website which sent me down a kinda fun analysis rabbit hole.Ĭaveat: browsers sometimes lie (see firefox gets my screens correct, chromium is internally doubling to account for the high resolution screen and reports 1/2 the correct screen size) and this also include the small amount of mobile traffic we get. Therefore I think that the best option might be the more painful one: drop fontsize from 12 to 10, and adjust everything else accordingly. The rationale for reducing the figsize was that (8, 6) is too large for most publication uses, and that with the increase in figure.dpi to 100 to match savefig.dpi, it is also too large for the screen, making it hard to work with multiple figures, and, depending on the user's screen, possibly even triggering resizing, which destroys any attempt to design a layout with fixed dimensions. I think the change to figsize is also responsible for many broken gallery examples as well. I omitted one option: I think that increasing the subplotparams wspace and hspace enough to make 4 subplots look reasonable would leave too little room for the plots themselves. In either case, of course, all positioning parameters will need to be reviewed and adjusted. Here is the default 4-panel figure, without even trying to add any labels or titles: For a single default subplot, possibly adequate adjustments have been made, but the situation for multiple subplots looks hopeless. Together with the infamous outward ticks, this change in figsize wreaks havoc on label placement and axes positions.
0 Comments
Leave a Reply. |