MATLAB: Disable font smoothing in colorbar object

colorbarfigure propertiesfont antialiasingfont hintingfont smoothingfontsmoothingMATLABtext properties

Hi everyone,
I am trying to produce a figure with the FontSmoothing property disabled throughout. The figure has one axes object with a title, two axis labels, two plot()'ted lines, a legend, and a colorbar. My problem is that I can't find a way to turn off font smoothing for the colorbar tick labels. The colorbar object does have a Label property which in turn has a FontSmoothing property, but turning that off only affects the colorbar label (as the name would suggest). The tick labels remain unaffected.
I have read other answers showing how to turn off font smoothing for legend objects (basically, you have to use the 4-output-argument form of legend()), but I could not find a way to do something similar for colorbar().
This is what I have been able to accomplish so far: (I am using MATLAB R2019a for Linux)
The colorbar tick labels remain font-smoothed.
The colorbar tick labels ( -16.5 through -19.5 ) clearly have some sort font smoothing (font antialiasing) enabled. How can I disable that?

Best Answer

  • cb = colorbar(appropriate_axes);
    cb.Ruler.FontSmoothing = 'off';