You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Slow curve rendering on HiDPI screens: use a cosmetic pen for curves of width 1 or less #80
With high-DPI scaling enabled (Windows at 125 % or 150 %), a curve with a line width of 1.0 is drawn 1.25 or 1.5 device pixels wide. Qt's raster engine then takes its slow path for wide pens: with antialiasing, drawing a noisy 2000-point curve takes ~800 ms at 150 % instead of ~2 to 3 ms with a one-device-pixel pen (Qt 5.15, measured with QPainter.drawPolyline on a QImage).
Noisy curve, 2000 points, antialiased
100 %
150 %
Width 1.0 (current pen)
1.6 ms
790 ms
Width 1.0, cosmetic pen
1.6 ms
2.8 ms
Proposed change
Curves (and error bars) whose line width is 1 or less use a cosmetic pen, i.e. a pen whose width is expressed in device pixels and is not affected by the device pixel ratio. The stored width (LineStyleParam.width) is unchanged.
A configuration option (plot section, curve/cosmetic_hairline, enabled by default) restores the previous behavior.
Activity
PierreRaybaut commentedon Oct 29, 2026
Fixed by #81 (merged into develop, will be released in PlotPy 2.12.0).