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.

MPHPLOT: Figure Resolution

Please login with a confirmed email address before reporting spam

Hi Everyone,

I am using mphplot to display contour plots within Matlab using the color table "Rainbow". The resolution of the resultant figure is really low compared wth how it looks within Comsol Multiphysics. I tried to look for any properties I could change to fix it but no luck so far.

Does anyone know any solution to this problem?

What I am planning to do right now is either: - Extract the plot from Comsol Muliphysics as png for example then displaying it in Matlab hoping it would have a better resolution. - Extract the raw plot data (as in a spreadsheet of values for example) from COMSOL Multiphysics then plot it using Matlab itself.

Any help is highly appreciated, many thanks. Mohamed Abdelhamid


5 Replies Last Post 9 avr. 2019, 21:18 UTC−4
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 20 nov. 2018, 06:08 UTC−5

Some effects are hard to reproduce in Matlab since we don't have low level access to all the features that makes up a plot. Hence there are often differences between the plots in Comsol and in Matlab. That being said, we try as hard as we can to make the plots appear the same in the two environments and we may have missed something.

By "resulution" do you mean the coordinates or the colours (or both)?

Are you able to share a model where you see this? You can either attach you model to a post in this Forum or you can send the model to support.

-------------------
Lars Gregersen
Comsol Denmark
Some effects are hard to reproduce in Matlab since we don't have low level access to all the features that makes up a plot. Hence there are often differences between the plots in Comsol and in Matlab. That being said, we try as hard as we can to make the plots appear the same in the two environments and we may have missed something. By "resulution" do you mean the coordinates or the colours (or both)? Are you able to share a model where you see this? You can either attach you model to a post in this Forum or you can send the model to support.

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 1 déc. 2018, 20:16 UTC−5

Hi Lars,

Thanks for your reply. I have attached two pngs, one through mphplot from Matlab, and the other one directly from Comsol Multiphysics. You can see the difference in the resolution of the image, it feels like mphplot dilutes the data before sending it to Matlab. Your input is highly appreciated.

Thanks, Mohamed Abdelhamid

Hi Lars, Thanks for your reply. I have attached two pngs, one through mphplot from Matlab, and the other one directly from Comsol Multiphysics. You can see the difference in the resolution of the image, it feels like mphplot dilutes the data before sending it to Matlab. Your input is highly appreciated. Thanks, Mohamed Abdelhamid


Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 3 déc. 2018, 06:09 UTC−5

Hi Mohamed

Try this: mphplot(model, 'pg2', 'indexedcolors', 'on')

Note: The indexedcolors property is experimental, undocumented and unsupported. It may disappear in a future release of Comsol.

-------------------
Lars Gregersen
Comsol Denmark
Hi Mohamed Try this: mphplot(model, 'pg2', 'indexedcolors', 'on') Note: The indexedcolors property is experimental, undocumented and unsupported. It may disappear in a future release of Comsol.

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 9 avr. 2019, 11:59 UTC−4

Hi Lars,

Sorry for the delayed reply. I tried your suggestion but no improvement. I discarded the importing the figure from COMSOL to MATLAB and simply did it directly in MATLAB and the results were much better.

Thanks again for your help.

Sincerely, Mohamed Abdelhamid

Hi Lars, Sorry for the delayed reply. I tried your suggestion but no improvement. I discarded the importing the figure from COMSOL to MATLAB and simply did it directly in MATLAB and the results were much better. Thanks again for your help. Sincerely, Mohamed Abdelhamid

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 5 years ago 9 avr. 2019, 21:18 UTC−4

Hi Mohamed

I'm glad it worked out for you.

If you feel that mphplot can be improved then please post your model and plotting code (or send it to support@comsol.com) and we'll have a look at it.

-------------------
Lars Gregersen
Comsol Denmark
Hi Mohamed I'm glad it worked out for you. If you feel that mphplot can be improved then please post your model and plotting code (or send it to support@comsol.com) and we'll have a look at it.

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.