#5262·ScottPlot

Possible bug in RenderDetails.TryGetUnitPerPixelX and TryGetUnitPerPixelY

Author: DaveMartelCreated Aug 3, 2026Updated Aug 3, 2026

Issue: It may be that I am misunderstanding the intention of these 2 methods. The code and the summary of the functions are self consistent. However I feel these are both wrong, and may be due to "Copy and Paste error in writing the methods.

There are 4 methods (2 each for X and Y, and they look like they mirror

PxPerUnit?? and UnitsPerPx??

PxPerUnit?? comes from PixelRect.Width/Height / AxisSpan UnitsPerPx?? comes from AxisSpan / PixelRect.Width/Height

In the TryGet... versions, the fall back (if the axis is not defined) in all cases falls back to PxPerUnit??

It seems to me that in...

...TryGetUnitPerPixelX it should fall back to UnitsPerPxX

...TryGetUnitPerPixelY it should fall back to UnitsPerPxY

If I am misunderstanding, then please accept my apologies

ScottPlot Version: 5.1.59 - WinForms

Code Sample: No code sample. This was clearly an observation on my understanding of expected behavior