Is it possible to color a single number (or a set of numbers) on one of the axes in MATLAB?
Suppose I have a plot:
plot(1:10, rand(1,10))
As an alternative to copying the entire axes contents, it is possible to do this also by creating additional axes objects:
ax = axes();
p = plot(1:10, rand(1,10));
myTick = 3;
% Create new axes with transparent backgrounds
ax2 = axes();
ax3 = axes();
set([ax2 ax3], 'XLim', xlim(ax));
set([ax2 ax3], 'Color', 'none');
set(ax3, 'XTick', [], 'YTick', []);
% Give one new axes a single tick mark
set(ax2, 'YTick', []);
set(ax2, 'XTick', myTick);
set(ax2, 'XColor', 'r');
% This line is necessary to use the plot toolbar functions like zoom / pan
linkaxes([ax ax2 ax3]);