From bug-octave-request at bevo dot che dot wisc dot edu Mon Nov 18 13:15:13 2002 Subject: Bug in plotting matrices, tracked down to bug in sprintf From: Jean-Francois Cardoso To: bug-octave at bevo dot che dot wisc dot edu Date: Sat, 16 Nov 2002 08:39:08 -0600 Bug in plotting matrices, tracked down to bug in sprintf The problem (already reported on octave bug list) with sprintf truncating strings of more than 99 characters induces a bug in plot.m I am reporting the problem here, for people wondering about weird problems in plotting matrices. Problem: define an 9x100 (say) matrix, like N=9 ; Mat = ones(1,100)'*(1:N)+0.1*randn(100,N) ; and try to plot the 9 columns by plot(Mat , '-') or by plot(Mat , '+') In the first case, the rows 6, 7 and 8 are not plotted. In the second case, plot aborts. This is due to plot building too long a string of commands to be sent to gnuplot. In the first case, the truncation still produces a valid gnuplot command, but with missing parts. In the second case, truncation produces an invalid string and plot aborts. HTH, JFC ------------------------------------------------------------- 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 -------------------------------------------------------------