Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Saving plot from mphplot() to disk

Please login with a confirmed email address before reporting spam

Hi,
I'm having a hard time trying to save a plot which comes from mphplot(). What I'm trying is:

figure;
mphplot(model,'pg3');
saveas(gcf,'result_plot.tiff');

But it just produces an error 'Warning: RGB color data not yet supported in Painter's mode'. So I guess it's an issue with the renderer Matlab uses. Changing the renderer with set(gcf,'Renderer','zbuffer'); does seems not to work.

Is there an easy way to save a Comsol Plot to disk?

2 Replies Last Post 09.06.2014, 10:58 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 23.04.2012, 05:57 GMT-4
I just figured it out - the renderer has to be set before calling mphplot():

h=figure;
set(h,'Renderer','zbuffer');
mphplot(model,'pg3');
saveas(h,'result_plot.jpg');

I just figured it out - the renderer has to be set before calling mphplot(): h=figure; set(h,'Renderer','zbuffer'); mphplot(model,'pg3'); saveas(h,'result_plot.jpg');

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 09.06.2014, 10:58 GMT-4
Thanks a lot for the update! Your solution works!
Thanks a lot for the update! Your solution works!

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.