I have a list of data where each point should have a label. I would like the labels to be below the plot, where tick labels usually are. This is what I have so far:

data = {1, 4, 3, 6};
labels = {"long name", "short", "what is this even", "this thing"};

 Ticks -> {MapIndexed[{First[#2], Rotate[#1, 90 Degree]} &, labels], Automatic}]

image of generated ListPlot

The problem is that the rotated labels are centered. How can I right-align the labels so that the space between the axis and the label is the same for each label?


1 Answer 1



Rotate[#1, 90 Degree, {Right, Center}]

instead. This moves the point of rotation to the right and vertical centre of the bounding box of each string.

What I suspect is that Mathematica aligns the bounding boxes by aligning their origins. By moving the rotation point, the origin is moved to that point perhaps, and now the boxes are right-aligned.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.