Mercurial > octave-nkf
comparison scripts/plot/__go_draw_axes__.m @ 6461:ed17f1c8f720
[project @ 2007-03-26 21:35:54 by jwe]
author | jwe |
---|---|
date | Mon, 26 Mar 2007 21:35:54 +0000 |
parents | 4067a8caff18 |
children | 75db909a53cc |
comparison
equal
deleted
inserted
replaced
6460:fa6312d93730 | 6461:ed17f1c8f720 |
---|---|
309 palette_set = 1; | 309 palette_set = 1; |
310 palette_size = rows (img_colormap); | 310 palette_size = rows (img_colormap); |
311 fprintf (plot_stream, | 311 fprintf (plot_stream, |
312 "set palette positive color model RGB maxcolors %i;\n", | 312 "set palette positive color model RGB maxcolors %i;\n", |
313 palette_size); | 313 palette_size); |
314 if (palette_size <= 128) | 314 fprintf (plot_stream, |
315 ## Break up command to avoid buffer overflow. | 315 "set palette file \"-\" binary record=%d using 1:2:3:4;\n", |
316 fprintf (plot_stream, "set palette file \"-\" using 1:2:3:4;\n"); | 316 palette_size); |
317 for i = 1:palette_size | 317 fwrite (plot_stream, [1:palette_size; img_colormap'], |
318 fprintf (plot_stream, "%g %g %g %g;\n", | 318 "float32", 0, "ieee-le"); |
319 1e-3*round (1e3*[(i-1)/(palette_size-1), img_colormap(i,:)])); | |
320 endfor | |
321 fprintf (plot_stream, "e;\n"); | |
322 else | |
323 ## Let the file be deleted when Octave exits or | |
324 ## `purge_tmp_files' is called. | |
325 [cmap_fid, cmap_fname, msg] = mkstemp (fullfile (P_tmpdir, "gpimageXXXXXX"), 1); | |
326 fwrite (cmap_fid, img_colormap', "float32", 0, "ieee-le"); | |
327 fclose (cmap_fid); | |
328 fprintf (plot_stream, | |
329 "set palette file \"%s\" binary record=%d using 1:2:3;\n", | |
330 cmap_fname, palette_size); | |
331 endif | |
332 endif | 319 endif |
333 endif | 320 endif |
334 fclose (img_fid); | 321 fclose (img_fid); |
335 | 322 |
336 filespec{data_idx} = img_fname; | 323 filespec{data_idx} = img_fname; |
667 rot_x = 90 - axis_obj.view(2); | 654 rot_x = 90 - axis_obj.view(2); |
668 rot_z = axis_obj.view(1); | 655 rot_z = axis_obj.view(1); |
669 while (rot_z < 0) | 656 while (rot_z < 0) |
670 rot_z += 360; | 657 rot_z += 360; |
671 endwhile | 658 endwhile |
659 fputs (plot_stream, "set ticslevel 0;\n"); | |
672 fprintf (plot_stream, "set view %g, %g;\n", rot_x, rot_z); | 660 fprintf (plot_stream, "set view %g, %g;\n", rot_x, rot_z); |
673 endif | 661 endif |
674 fprintf (plot_stream, "%s \"%s\" %s %s %s", plot_cmd, | 662 fprintf (plot_stream, "%s \"%s\" %s %s %s", plot_cmd, |
675 filespec{1}, usingclause{1}, titlespec{1}, withclause{1}); | 663 filespec{1}, usingclause{1}, titlespec{1}, withclause{1}); |
676 for i = 2:data_idx | 664 for i = 2:data_idx |