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
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
![image](https://user-images.githubusercontent.com/30056115/107064240-4b932300-67a9-11eb-9c5b-fdbfe1a4dcfc.png)
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 aRotateAngle(u32)
(or some float?) variant to theFontTransform
enum and adding something likeFontTransform::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 currentplotters
tests