From bug-request at octave dot org Fri Dec 3 07:10:08 2004 Subject: Re: 'text' problems From: "John W. Eaton" To: "Pascal A. Dupuis" Cc: bug-octave at bevo dot che dot wisc dot edu Date: Fri, 3 Dec 2004 08:10:36 -0500 On 3-Dec-2004, Pascal A. Dupuis wrote: | 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 ? If you are asking me, this seems fine, but text.m is currently part of Octave forge so it is not up to me to fix. jwe ------------------------------------------------------------- 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 -------------------------------------------------------------