plotters
plotters copied to clipboard
[Feature Request] Arbitrary angle for text rotation
What is the feature ?
It would be nice to be able to rotate text to some arbitrary angle (besides just 0/90/180/270 degrees)
(Optional) Why this feature is useful and how people would use the feature ?
I'm using plotters to generate some bar charts, but when the number of bars/labels gets relatively large (or the labels are long), it can be impossible to keep the labels a readable size without overlapping.
Coming from a limited plotly background, it would be nice to be able to replicate what they do with their bar charts when there are a lot of labels (albeit a bit more manually) by slanting them. For example, these screenshots from their bar chart page (same chart, just zoomed in to show fewer bars):

(Optional) Additional Information
Without knowing too much about the details of plotters-backend, I'd image that just adding a RotateAngle(u32) (or some float?) variant to the FontTransform enum and adding something like
FontTransform::RotateAngle(angle) => (x * angle.cos(), y * angle.sin()),
to the transform method. I'll do exactly that in a PR and try to run the current plotters tests
I see that this feature was somehow merged at one point, then reversed.
Is there anyone working on it right know? I'm okay with funding the work if necessary 😉