MATLAB: Fontsize and properties of Xticklabels using figure handles

fontsizehandles xticklabelsxaxis

How do I cange the Xticklabels of a plot using figure handles?

Best Answer

"How do I cange the Xticklabels of a plot using figure handles?"
Get the axis handle from the figure handle.
ax = gca(figureHandle);
Get the XAxis handle from the axis handle and set the FontSize of the x-axis only.
ax.XAxis.FontSize = 16;
or set the fontsize of the entire axis (x & y)
ax.FontSize = 14;
Set the XTick and XTick labels
ax.XTick = 1:4;
ax.XTickLabel = {'A' 'B' 'C' 'D'};