From bug-request at octave dot org Fri Dec 3 07:02:42 2004 Subject: Re: 'text' problems From: "Pascal A. Dupuis" To: bug-octave at bevo dot che dot wisc dot edu Date: Fri, 3 Dec 2004 03:12:40 -0600 This is a followup to my previous message. I tried various scalings for the second graph, and I finally got correct results. The culprit is to be found in plot/text.m, around line 147: atstr = sprintf("%f,%f", position(1),position(2)); str = sprintf("%f", 1e-9) results in ... 0! The following patch seems to work for me: --------------------------------------------------- --- text.m.orig 2004-12-03 10:08:10.000000000 +0100 +++ text.m 2004-12-03 10:08:42.000000000 +0100 at @ -147,9 +147,9 @@ font = ""; endif if position(3)!=0, - atstr = sprintf("%f,%f,%f", position(1),position(2),position(3)); + atstr = sprintf("%e,%e,%e", position(1),position(2),position(3)); else - atstr = sprintf("%f,%f", position(1),position(2)); + atstr = sprintf("%e,%e", position(1),position(2)); endif command = sprintf('gset label "%s" at %s %s %s %s%s', str, units, atstr, align, rotate, font); ---------------------------------------------------------- John ? Pascal -- Dr. ir. Pascal Dupuis K. U. Leuven, ESAT/ELECTA (formerly ELEN): http://www.esat.kuleuven.ac.be/ Kasteelpark Arenberg, 10; B-3001 Leuven-Heverlee, Belgium Tel. +32-16-32 10 21 -- Fax +32-16-32 19 85 ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------