octave-maintainers
[Top][All Lists]
Advanced

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

Multiline labels in graphics


From: Daniel J Sebald
Subject: Multiline labels in graphics
Date: Sun, 23 Mar 2008 13:27:16 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

I tried to patch Octave to support cell arrays; the attached rudimentary patch works in principle, but has a problem: with enhanced text terminals, the warnings

enhanced text mode parser - ignoring spurious }
enhanced text mode parser - ignoring spurious }

from Gnuplot are dumped. I assume that the graphics code implicitly assumes there's no newlines in the texts.

Does somebody with better knowledge of the graphics code have a clue what's going on, and even better, find a way how to fix the problem?

Thanks,

Moritz

Moritz,

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?  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");

Dan


reply via email to

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