Is there an option with the command-line version of the matlab print command that will provide the ability to resize/rescale the graphic?
That is, I would like to rescale the image size for printing to the printer, but would like to do so using the command line (below) and not the menu/GUI print dialog box.
>> print -Pprintername -options
Thanks!
Jeff
|
|
0
|
|
|
|
Reply
|
Jeffrey
|
5/17/2010 6:36:04 PM |
|
"Jeffrey Roth" <jroth@ll.mit.edu> wrote in message <hss2ak$eed$1@fred.mathworks.com>...
> Is there an option with the command-line version of the matlab print command that will provide the ability to resize/rescale the graphic?
>
> That is, I would like to rescale the image size for printing to the printer, but would like to do so using the command line (below) and not the menu/GUI print dialog box.
>
> >> print -Pprintername -options
>
> Thanks!
> Jeff
a hint:
- you can tune your figure using these figure parameters...
set(gcf,...
'PaperUnits',...,...
'PaperOrientation',...,...
'PaperPosition',...,...
'PaperSize',...,...
'PaperType',...,...
);
us
|
|
0
|
|
|
|
Reply
|
us
|
5/17/2010 6:54:04 PM
|
|
"Jeffrey Roth" <jroth@ll.mit.edu> wrote in message <hss2ak$eed$1@fred.mathworks.com>...
> Is there an option with the command-line version of the matlab print command that will provide the ability to resize/rescale the graphic?
>
> That is, I would like to rescale the image size for printing to the printer, but would like to do so using the command line (below) and not the menu/GUI print dialog box.
>
> >> print -Pprintername -options
>
> Thanks!
> Jeff
If you are going to use the command line interface, why not just send the image to the ImageMagick 'convert' command that you can embed in your Matlab script? Imagemagick is a very powerful series of CLI tools that can manipulate images from multiple formats. Check it out at imagemagick.org.
Good luck!
|
|
0
|
|
|
|
Reply
|
Rob
|
5/17/2010 8:39:04 PM
|
|
Hi everyone,
I have another "command line printing" of figure issue.
here is my code:
at first I run a plot function that makes a plot in the current figure handles
plot_fill(handles); %ext function that makes a plot in a figure/gcf
then I set the size of the plot as desired and print it to file (file1.png)
set(gcf, 'paperunits', 'inches');
set(gcf, 'papersize', [8.335,6]); %600x432 pixel at 71.984 dpi
set(gcf, 'paperposition',[0,0,8.335,6])
print(gcf,'-dpng', 'file1.png'); %print 1st output file
next, I change the size of the plot/figure for the desired file2.png
set(gca, 'FontSize', 8);
set(gcf, 'papersize', [3.82,2.751]); %275x200 pixel at 71.984 dpi
set(gcf, 'paperposition',[0,0,3.82,2.751])
print(gcf,'-dpng', 'file2.png'); %print 2nd output file
What happens is... the sizes of both files come out fine,
BUT in file2.png all the legends, titles, xlabels, ylabels and texts are still in the original size (font size 16 or 12) and overlay half the actual plot!
What i've tried so far:
- set(gca, 'FontSize', 8); before printing file2.png
- print the files the other way around
- don't print file1.png at all and only file2.png
None of those ideas work :(
I cant adjust anything manually, since the plots are for a web tool where plots are generated automatically.
In general I am a big fan of matlab, but I think the functions for rescaling pictures are not really the best. The quality of the plots in png format is not convenient either (e.g. -r300 doesnt help much). They look a lot nicer when I save them manually as an eps and then convert them to png with external software...
Anyway, I hope someone has a solution for this!
Thanks!
|
|
0
|
|
|
|
Reply
|
olim
|
9/8/2010 10:42:22 PM
|
|
Hi everyone,
I have another "command line printing" of figure issue.
here is my code:
at first I run a plot function that makes a plot in the current figure handles
plot_fill(handles); %ext function that makes a plot in a figure/gcf
then I set the size of the plot as desired and print it to file (file1.png)
set(gcf, 'paperunits', 'inches');
set(gcf, 'papersize', [8.335,6]); %600x432 pixel at 71.984 dpi
set(gcf, 'paperposition',[0,0,8.335,6])
print(gcf,'-dpng', 'file1.png'); %print 1st output file
next, I change the size of the plot/figure for the desired file2.png
set(gca, 'FontSize', 8);
set(gcf, 'papersize', [3.82,2.751]); %275x200 pixel at 71.984 dpi
set(gcf, 'paperposition',[0,0,3.82,2.751])
print(gcf,'-dpng', 'file2.png'); %print 2nd output file
What happens is... the sizes of both files come out fine,
BUT in file2.png all the legends, titles, xlabels, ylabels and texts are still in the original size (font size 16 or 12) and overlay half the actual plot!
What i've tried so far:
- set(gca, 'FontSize', 8); before printing file2.png
- print the files the other way around
- don't print file1.png at all and only file2.png
None of those ideas work :(
I cant adjust anything manually, since the plots are for a web tool where plots are generated automatically.
In general I am a big fan of matlab, but I think the functions for rescaling pictures are not really the best. The quality of the plots in png format is not convenient either (e.g. -r300 doesnt help much). They look a lot nicer when I save them manually as an eps and then convert them to png with external software...
Anyway, I hope someone has a solution for this!
Thanks!
|
|
0
|
|
|
|
Reply
|
olim
|
9/8/2010 10:44:24 PM
|
|
|
4 Replies
372 Views
(page loaded in 0.058 seconds)
|