Menu

Problem with Angled X-Axis lables

Badda
2016-01-26
2016-02-02
  • Badda

    Badda - 2016-01-26

    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
  • lbayuk

    lbayuk - 2016-01-28

    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.

     
  • Badda

    Badda - 2016-02-02

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.