|
On May 3, 2:22 am, "p. west" <p...@dbresearch.NOSPAM.net> wrote:
> I want to run MATLAB processing at night in batch mode on a SUN.
> Some of the output needs to be high quality jpegs that can be
> inserted into PowerPoint but I am having trouble using the -djpeg99
> option. To try to understand this problem I wrote a plottest.m to
> just produce a couple of figures. One with the default quality and
> one with a quality of 99.
>
> plottest.m is:
> create a figure
> print(gcf,'-djpeg','TestPlotDefault');
> create another figure
> print(gcf,'-djpeg99','TestPlot99');
>
> As long as I run matlab with the following and don't interfere with
> the figures plotting to the screen, the TestPlot99 produces a good
> looking result.
> >>matlab -nojvm -nosplash -r plottest
>
> But this ONLY works if I allow the figures to print to the screen.
> In other words batching this at night when I am logged off produces
> nothing.
>
> If I try to batch this at night with the -nodisplay option, I get the
> TestPlotDefault file (The one using -djpeg) but an error is occurs on
> the -djpeg99 option. Specifically,
>
> at $MyTime << EoF
> matlab -nojvm -nodisplay -nosplash -r plottest
> Eof
>
> produces the error:
>
> Error using => print
> Error using ==? graphics/private/ghostscript
> Problem calling GhostScript System returned error
>
> Does anyone see a way around this??? I am wondering if there is
> something I can do to the DISPLAY env to get this to work.
>
> Any advice is appreciated.
I've been able to save images from non-visible plots before. However
I've never used the print command.
Try using saveas() ie saveas(gcf, 'TestPlotDefault.jpg', 'jpg');
obviously this does not let you adjust the quality of the saved jpg.
But have you thought about using PNGs? Similar file size, and for
plots, graphss, regions of filled colour etc, they provide excellent
image quality. (and can be used by saveas)
|