octave-maintainers
[Top][All Lists]
Advanced

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

Re: tmp gets full when plotting many images


From: Daniel J Sebald
Subject: Re: tmp gets full when plotting many images
Date: Mon, 26 Mar 2007 17:35:43 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

John W. Eaton wrote:
On 26-Mar-2007, Daniel J Sebald wrote:

| | It seems to me that the use of the 4 columns is ultimately the same once gnuplot | takes 1,2,3,4,5,... and maps it to [0,1]. | | Anyway, here's a patch to illustrate using binary data. Give it a try and see | if you like it. (If you want to stay ASCII, remove the "binary" portion of the | option and use fprintf instead.) It shouldn't be too difficult to make the | changes for sending the line/surface/image data as binary as well.

I applied the patch and checked it in.

Oops, have to be a "little" bit careful (ar, ar). Here are some more subtle changes addressing endian declaration to ensure things work across multiple platforms and CPUs.

Dan
--- /usr/local/src/octave-cvs/octave/scripts/plot/__go_draw_axes__.m    
2007-03-26 17:26:05.000000000 -0500
+++ ./__go_draw_axes__.m        2007-03-26 17:31:23.491097333 -0500
@@ -296,11 +296,11 @@
            ## is called.
            [img_fid, img_fname] = mkstemp (fullfile (P_tmpdir, 
"gpimageXXXXXX"), 1);
            if (ndims (img_data) == 3)
-             fwrite (img_fid, permute (img_data, [3, 1, 2])(:), "float");
+             fwrite (img_fid, permute (img_data, [3, 1, 2])(:), "float", 0, 
"ieee-le");
              format = "1:2:3";
              imagetype = "rgbimage";
            else
-             fwrite (img_fid, img_data(:), "float");
+             fwrite (img_fid, img_data(:), "float",  0, "ieee-le");
              format = "1";
              imagetype = "image";
              ## Only need to set pallete once because it doesn't change
@@ -312,7 +312,7 @@
                         "set palette positive color model RGB maxcolors %i;\n",
                         palette_size);
                fprintf (plot_stream,
-                        "set palette file \"-\" binary record=%d using 
1:2:3:4;\n",
+                        "set palette file \"-\" binary endian=little record=%d 
using 1:2:3:4;\n",
                         palette_size);
                fwrite (plot_stream, [1:palette_size; img_colormap'],
                        "float32", 0, "ieee-le");
@@ -322,7 +322,7 @@
 
            filespec{data_idx} = img_fname;
            titlespec{data_idx} = "";
-           usingclause{data_idx} = sprintf ("binary array=%dx%d scan=yx 
origin=(%g,%g) dx=%g dy=%g using %s",
+           usingclause{data_idx} = sprintf ("binary endian=little array=%dx%d 
scan=yx origin=(%g,%g) dx=%g dy=%g using %s",
                x_dim, y_dim, x_origin, y_origin, dx, dy, format);
            withclause{data_idx} = sprintf ("with %s", imagetype);
 

reply via email to

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