I have the following problem: I have a barchart with 45° angled X-Axis labels, these labels have various lengths. Now, due to the fact that PHPlot always aligns the horizontal center of the label with the horizontal center of the respecitve bar, the labels are overwriting each other (especially if I have a long label on the left and a short label on the right). The desired bahavior would be, to align the right (or left) edge of the label with the right (or left) edge of the respective bar.
How can I achieve this?
Last edit: Badda 2016-01-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As you found, PHPlot always draws labels below the X axis using "horizontal: center, vertical: top" alignment. (The alignment applies to a bounding box around the text.) There isn't any way to change this now, but I want to see what it would look like as you describe (align side of label with side of bar).
Usually with long labels, the advice is to have the text at 90 degree.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It would look like this:
The center of the leftmost/rightmost character is fixed right below the x-axis tick - this is also the center of rotation when rotating the text.This way, the distance between the labels will always stay the same, no matter what length of the label or what angle of rotation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have the following problem: I have a barchart with 45° angled X-Axis labels, these labels have various lengths. Now, due to the fact that PHPlot always aligns the horizontal center of the label with the horizontal center of the respecitve bar, the labels are overwriting each other (especially if I have a long label on the left and a short label on the right). The desired bahavior would be, to align the right (or left) edge of the label with the right (or left) edge of the respective bar.
How can I achieve this?
Last edit: Badda 2016-01-26
As you found, PHPlot always draws labels below the X axis using "horizontal: center, vertical: top" alignment. (The alignment applies to a bounding box around the text.) There isn't any way to change this now, but I want to see what it would look like as you describe (align side of label with side of bar).
Usually with long labels, the advice is to have the text at 90 degree.
It would look like this:
The center of the leftmost/rightmost character is fixed right below the x-axis tick - this is also the center of rotation when rotating the text.This way, the distance between the labels will always stay the same, no matter what length of the label or what angle of rotation.