octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiline labels in graphics


From: Moritz Borgmann
Subject: Re: Multiline labels in graphics
Date: Sun, 23 Mar 2008 23:48:25 +0100

Gnuplot has a demo "enhancedtext.dem" that uses the following syntax and produces multiline text (which is left aligned by default):

set label 8 "Overprint\n(v should be centred over d)" tc lt 3

Is this what you are looking for?

yep, adding \n per se works, and it's essentially what I'm doing. The problem is not inserting the \n, but what Octave does to it afterward... (slapping braces around the whole thing, which will confuse gnuplot...)

Just briefly looking at the patch you created, this line

+        concatenated = horzcat (concatenated, "\n");

is suspicious because it places a new line character of the string that is fed to gnuplot meaning gnuplot thinks it is an end of a line, hence error. I think what you actually want is to place two characters in the stream, the backslash and the 'n':

+        concatenated = horzcat (concatenated, "\\n");

did you try it? I think it doesn't work, which can be tested easily:

title("bla\\nblabla")

dumps a "n" in enhanced mode and dumps a literal "\n" without enhanced mode.

-M


reply via email to

[Prev in Thread] Current Thread [Next in Thread]