In an androidplot XYPlot, the tick labels on the Y axis get clipped if you have large values (many digits) and/or a large font size. This (and similar issues on the X axis) has been discussed before in these questions:
- Range field in Android Plot (0.6.1.) is not showing the entire number
- Androidplot - X-Axis labels cut off
- https://groups.google.com/forum/#!topic/androidplot/b0zLJl9Bx-0
- https://groups.google.com/forum/#!topic/androidplot/w4EK4B_W-74
The answer is always to add more padding and/or margin in order to have enough space for the labels.
My question is: How can I set the padding/margin to have just the right amount of space?
Simply hardcoding the left margin to some value is a suboptimal solution. Let's assume I want to plot some data and I don't know in advance if the Y values will be in the range [0,9] or in the range [10000,20000]. How can I set the padding/margin to avoid both clipping and unnecessary empty space?