comparison scripts/plot/print.m @ 9000:cc916241e811

print.m: Restore the old behavior for -S<num>,<num>.
author Ben Abbott <bpabbott@mac.com>
date Sat, 21 Mar 2009 09:35:35 -0400
parents eb63fbe60fab
children 97aa01a85ea4
comparison
equal deleted inserted replaced
8999:dc07bc4157b8 9000:cc916241e811
425 if (! isfield (figure_properties, "__pixels_per_inch__")) 425 if (! isfield (figure_properties, "__pixels_per_inch__"))
426 addproperty ("__pixels_per_inch__", gcf, "double", resolution); 426 addproperty ("__pixels_per_inch__", gcf, "double", resolution);
427 endif 427 endif
428 set (gcf, "__pixels_per_inch__", resolution) 428 set (gcf, "__pixels_per_inch__", resolution)
429 429
430 if (debug) 430 unwind_protect
431 drawnow (new_terminal, name, mono, debug_file); 431 if (! isempty (size))
432 else 432 size_in_pixels = sscanf (size ,"%d, %d");
433 drawnow (new_terminal, name, mono); 433 size_in_pixels = reshape (size_in_pixels, [1, numel(size_in_pixels)]);
434 endif 434 size_in_inches = size_in_pixels ./ resolution;
435 p.paperunits = get (gcf, "paperunits");
436 p.papertype = get (gcf, "papertype");
437 p.papersize = get (gcf, "papersize");
438 p.paperposition = get (gcf, "paperposition");
439 p.paperpositionmode = get (gcf, "paperpositionmode");
440 set (gcf, "paperunits", "inches");
441 set (gcf, "papertype", "<custom>");
442 set (gcf, "papersize", size_in_inches);
443 set (gcf, "paperposition", [0, 0, size_in_inches]);
444 set (gcf, "paperpositionmode", "manual");
445 endif
446 if (debug)
447 drawnow (new_terminal, name, mono, debug_file);
448 else
449 drawnow (new_terminal, name, mono);
450 endif
451 unwind_protect_cleanup
452 ## FIXME - it would be preferred to delete the added properties here.
453 if (! isempty (size))
454 props = fieldnames (p);
455 for n = 1:numel(props)
456 set (gcf, props{n}, p.(props{n}))
457 endfor
458 endif
459 end_unwind_protect
435 460
436 if (! isempty (convertname)) 461 if (! isempty (convertname))
437 command = sprintf ("convert '%s' '%s'", name, convertname); 462 command = sprintf ("convert '%s' '%s'", name, convertname);
438 [errcode, output] = system (command); 463 [errcode, output] = system (command);
439 unlink (name); 464 unlink (name);