MATLAB: How to move position of tick labels on a polar histogram plot

polarpolarhistogramrose plotrticklabelsthetaticklabels

Hi all,
I am working with angular data that is best represented using a polar histogram, and was pleased to see that the latest 2016b version now has a dedicated polar histogram plot (polarhistogram). I've managed to customize the code to plot the mean angle of my data on the arc of the plot, and display the data on a 90° wedge with color, orientation, and limits that suit my needs.
However, I'm struggling with a very minor stylistic issue, which is the placement of the theta tick labels. As you see in the attached example, the 90° theta tick label is spilling into the 100% radial tick label, and I can't seem to figure out how to move it.
All I would like to do is move the 90° tick label up by several pixels.
Is this possible?
Thank you for the help, Oggie

Best Answer

This is a pretty kludgy way to do it, but it works. I hope there is something better!

theta = [0.1 1.1 5.4 3.4 2.3 4.5 3.2 3.4 5.6 2.3 2.1 3.5 0.6 6.1];
figure
polarhistogram(theta,6)
set(gca,'ThetaTick',     [0 30 60 90 120 150 180 210 240 270 300 330], ...
        'ThetaTickLabel',{'' 30 60 90 120 150 180 210 240 270 300 330})
text(0.1,4,'0-ish')

Here's what I've done:

  • Started with the first example in the documentation
  • Manually added the theta tick locations
  • Manually added the theta tick labels (using a cell array), but notice that I've put a empty character where the 0 would have been
  • Added text (slightly offset from zero) as an additional "tick label"

Here's the result. (Notice that the actual tick location was not affected, but the label is offset.)