Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Matlab crashes on pressing print button in editor (R14 OS X)

23 views
Skip to first unread message

MarkusHänchen

unread,
Jan 26, 2006, 5:30:54 PM1/26/06
to
Matlab crashes every time on pressing print button in editor (Matlab
7.1 R14 SP3 Mac OS X 10.4.x).

cmd-P shows no response.
File -> Print shows no response either.

Anybody else with the same problem?
Any solutions?


daniel ennis

unread,
Jan 27, 2006, 12:12:55 PM1/27/06
to
I accidently posted a response in another post. You can see the
original post here:

David Stewart, "Matlab on OSX (Tiger)" #, 26 Jan 2006 8:34 pm </WebX?14@@.ef26d03>


Or here...

Printing on OS X with R14 seems to really stink! Sorry TMW, but its
true...at least more me...and others...

You can read some of the complaints here:

twigster, "Matlab on Mac OS X Tiger?" #, 1 May 2005 5:06 am


And here:

Karen Lipkow, "R14sp3 and Mac OS X 10.4.2" #, 30 Sep 2005 7:12 am


The only thing that works *somewhat* reliably for me right now is to
print from the command line to a TIFF. I do a lot of "high-end"
graphical rendering and the print function (menu or command line
driven) barfs all the time. My favorite error today...after many
hours of wrestling with printing a figure for a manuscript is the
following:

setting PBuffer for OpenGL printing: invalid drawable

The result is a completely black image. It will be difficult to
convince the reviewers that this is meaningful.

</begin rant...if it didn't begin already>
Fortunately, I can back up to Matlab 7.0 (rather than 7.1)...oh
wait...that gives me license manager errors ever since I switched to
7.1...I could always uninstall, then reinstall, perhaps downgrade to
Oroborosx...
</end rant>

So as to be a bit more helpful I'll offer this as a starting point
for something that should work:

>> figure; [x,y,z]=sphere; s=surf(x,y,z);
>> print(gcf,'-dtiff','-r600','test');
setting PBuffer for OpenGL printing: invalid drawable

Ta dah! Black test.tif!!!!! What is PBuffer? Is it supposed to be
ZBuffer?

Printing at lower resolutions works fine, but this quality is minimal

for publications. I'd be happy to detail other problems.

MarkusHänchen

unread,
Jan 27, 2006, 2:13:28 PM1/27/06
to
On 2006-01-27 18:12:55 +0100, "daniel ennis" <daniel...@comcast.net> said:
>
> Printing on OS X with R14 seems to really stink! Sorry TMW, but its
> true...at least more me...and others...

For figure printing, I curently either save as eps or png via the menu
or use the following code:

% -------------------------------------------------
% Convert & save figure to a pdf and print directly
% -------------------------------------------------
set(gcf,'PaperOrientation','portrait');
set(gcf, 'PaperUnits', 'centimeters');
set(gcf, 'PaperType', 'A4');
set(gcf, 'PaperPosition', [1.5, 2, 18, 27]); % for portrait orientation
% set(gcf, 'PaperPosition', [1.5, 5, 18, 12]); % for landscape orientation
filenamestring_ct = ['Plot_R' num2str(exp_num, '%3.0f') 'conc_over_time.pdf'];
print(gcf, '-dpdf', filenamestring_ct);
if open_pdf ==1
open_string = ['open -a Texshop ', filenamestring_ct];
system(open_string);
end
if print_pdf == 1
print_string = ['open -a /Applications/Utilities/Printer\ Setup\
Utility.app ', filenamestring_ct];
system(print_string);
end

daniel ennis

unread,
Jan 27, 2006, 2:36:52 PM1/27/06
to
> For figure printing, I curently either save as eps or png via the
> menu or use the following code:

The problem is that printing from the menu gives you no control over
the ouput resolution...unless there is a setting I don't know about.
The result of EPS and PDF outputs are loew-resolution bitmaps which
look really cruddy when you print them on a laser printer.
Furthermore, the Adobe Illustrator option barfs with this message:

Error using ==> hgexport
Error using ==> print
Error using ==> print
Error using ==> graphics/private/render
Error using ==> hardcopy
Adobe Illustratory driver does not print Z-buffer or OpenGL Mode.

If you switch to Painters, then I get this error:

Warning: RGB color data not yet supported in Painter's mode.

And the colored patches in my figure disappear.

Like I said earlier, the only option that works reasonably well is to
print to a hi-res TIFF, which is okay, but leaves a lot to be desired.

MarkusHänchen

unread,
Jan 27, 2006, 6:32:52 PM1/27/06
to
> The problem is that printing from the menu gives you no control over
> the ouput resolution...
True, but for a quick and dirty solution, and what else are bitmaps
good for, the default resolution, of pngs at least, is good enough.

>
> The result of EPS and PDF outputs are loew-resolution bitmaps which
> look really cruddy when you print them on a laser printer.
> Furthermore, the Adobe Illustrator option barfs with this message:

My eps and pdf files work fine, in Illustrator 11, Acrobat 7, Latex
(not in preview, though) and are true vector graphics, no matter how I
produce them.

Bill Moldestad

unread,
Feb 27, 2006, 6:17:54 PM2/27/06
to
I had the same problem and contacted Matlab tech support. I'm
running Mac OS X 10.4.5., and using the same version of Matlab. What
they thought the problem was and told me to do about is:

'The printing may be failing because it is expecting a Mac OS
'libTIFF.dylib', but finding the already loaded MATLAB supplied
library, which isn't the same or compatible.'

'To workaround this issue, rename the MATLAB supplied library so that
printing uses the library file which comes with the Mac OS.
1. Open the Mac OS Terminal application, and type the following:
cd <matlabroot>/bin/mac ( where <matlabroot> is the
directory in which MATLAB is installed.
mv libtiff.3.7.1.dylib libtiff.old'

All I can say is based on my situation this fix worked, I can now
print. I hope that helps.

Bill

Martijn Henriquez

unread,
Mar 20, 2010, 9:11:03 PM3/20/10
to
=?ISO-8859-1?Q?Markus_H=E4nchen?= wrote in message <43d9...@news1.ethz.ch>...

Adding the option '-zbuffer' in the print command solved it for me.

andrej

unread,
Dec 30, 2011, 3:06:08 PM12/30/11
to
"Bill Moldestad" <bill....@gmail.com> wrote in message <ef26...@webx.raydaftYaTP>...
Just wanted to mention that I'm running osx 10.6.8 w/R2011a and this fix worked for me too.

Thomas Clark

unread,
Jan 4, 2012, 12:14:08 PM1/4/12
to
I'm experiencing the same issue on OSX 10.6.8 with R2011a

Being a 64 bit system, I changed the library in the /<matlabroot>/bin/maci64 folder rather than the /mac folder.

The fix above did NOT work; it instead led to invalid MEX file issues.

*begin rant - optional reading*
Printing and exporting figures has _never_ been easy in MATLAB. When, oh when will TMW get it right!!!
0 new messages