MATLAB Answers

0

Why can't I define separate tick mark labels using pipes in MATLAB R2014b?

Why can't I define separate tick mark labels using pipes in MATLAB R2014b?

Products


Release

R2014b

1 Answer

Answer by MathWorks Support Team on 7 Oct 2014
 Accepted Answer

Starting in MATLAB R2014b, do not use the vertical slash character, |, to separate tick mark labels.  MATLAB R2014b interprets the vertical slash character literally and not as a delimiter.  For example, this code displays the entire set of labels at each tick mark.
plot(1:10,1:10)
ax = gca;
ax.YTickLabel = 'A|B|C|D|E|F|G|H|I|J';
To define multiple strings for the XTickLabel, YTickLabel, and ZTickLabel axes properties, use a cell array.    
plot(1:10,1:10)
ax = gca;
ax.YTickLabel = {'A','B','C','D','E','F','G','H','I','J'};

  0 Comments

Sign in to comment.