0

I was using R ggplot for data visualization, and I met the problem centering the tick labels between tick marks on x/y axes. Here's a similar question but the implementation is matplotlib.

This is what I had (the wrong version): enter image description here

And this is what I expected: enter image description here

THANKS A LOT!!!

PPPatrick
  • 39
  • 5

1 Answers1

2

It is hard to reproduce your plot without the data you used to create the plot or the code you used to generate the plot

You can move the x-axis labels to the right by adding the following code to your plot

+ theme(axis.text.x=element_text(hjust=-0.5))

Additionally, one option might be just to rotate the x-axis labels instead of moving them. You can do this by adding the following code

+ theme(axis.text.x=element_text(angle = 90))
neuron
  • 1,949
  • 1
  • 15
  • 30