I tried to print text into figure which consists of more than one line. The obvious approach does not work. Neither '\n' nor '\r\n' are recognised.
example:
figure
plot(0:0.1:2*pi, sin(0:0.1:2*pi), 'b.-');
text(pi,0,'This is at Pi/0\nThis should appear one line below');
text(pi,0.5,'This is at Pi/0.5\r\nThis should appear one line below');
title('Title line 1\nTitle line 2');
Am I doing something wrong?
ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, no multiline text yet ...
I will put this in the feature request list. In the meanwhile, you can try doing this manually (e.g. putting two single lines of text one below the other). As for a multiline title - you'll have to wait
Shai
p.s. what is Matlb's behaviour in this case ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I tried to print text into figure which consists of more than one line. The obvious approach does not work. Neither '\n' nor '\r\n' are recognised.
example:
figure
plot(0:0.1:2*pi, sin(0:0.1:2*pi), 'b.-');
text(pi,0,'This is at Pi/0\nThis should appear one line below');
text(pi,0.5,'This is at Pi/0.5\r\nThis should appear one line below');
title('Title line 1\nTitle line 2');
Am I doing something wrong?
ben
Sorry, no multiline text yet ...
I will put this in the feature request list. In the meanwhile, you can try doing this manually (e.g. putting two single lines of text one below the other). As for a multiline title - you'll have to wait
Shai
p.s. what is Matlb's behaviour in this case ?
Sorry for the long delay,
Matlab R12p1 handles multiline text in title seemingly like multiline text in TEXT()
figure
tlt = sprintf('this is line1\nthis is line2');
title(tlt);
prints a two-line title - although it looks ugly, so I would not recommend using it.
ben