comparison doc/interpreter/plotimages.m @ 9912:e9fe12c1b0c0

Set default papersize to the desired imagesize Set default paperorientation to landscape to stop warning message
author Rik <rdrider0-list@yahoo.com>
date Fri, 04 Dec 2009 09:45:15 -0800
parents 20ee7f9cc904
children e76d8c767584
comparison
equal deleted inserted replaced
9911:ac7606d51a3d 9912:e9fe12c1b0c0
21 hide_output (); 21 hide_output ();
22 22
23 if (strcmp (typ, "png")) 23 if (strcmp (typ, "png"))
24 set (0, "defaulttextfontname", "*"); 24 set (0, "defaulttextfontname", "*");
25 endif 25 endif
26
26 if (strcmp(typ , "txt")) 27 if (strcmp(typ , "txt"))
27 image_as_txt(nm); 28 image_as_txt(nm);
28 elseif (strcmp (nm, "plot")) 29 elseif (strcmp (nm, "plot"))
29 x = -10:0.1:10; 30 x = -10:0.1:10;
30 plot (x, sin (x)); 31 plot (x, sin (x));
75 76
76 function set_print_size () 77 function set_print_size ()
77 image_size = [5.0, 3.5]; # in inches, 16:9 format 78 image_size = [5.0, 3.5]; # in inches, 16:9 format
78 border = 0; # For postscript use 50/72 79 border = 0; # For postscript use 50/72
79 set (0, "defaultfigurepapertype", "<custom>"); 80 set (0, "defaultfigurepapertype", "<custom>");
81 set (0, "defaultfigurepaperorientation", "landscape");
80 set (0, "defaultfigurepapersize", image_size + 2*border); 82 set (0, "defaultfigurepapersize", image_size + 2*border);
81 set (0, "defaultfigurepaperposition", [border, border, image_size]); 83 set (0, "defaultfigurepaperposition", [border, border, image_size]);
82 endfunction 84 endfunction
83 85
86 ## Use this function before plotting commands and after every call to
87 ## print since print() resets output to stdout (unfortunately, gnpulot
88 ## can't pop output as it can the terminal type).
84 function hide_output () 89 function hide_output ()
85 f = figure (1); 90 f = figure (1);
86 set (f, "visible", "off"); 91 set (f, "visible", "off");
87 endfunction 92 endfunction
88 93