Combining two contourplots in one plot

7 views (last 30 days)
Hi,
I am trying to combine two contour plots in one single plot. The problem is, that the results is not really satisfying. First you can see the first contourplot. The data is a 571x96 Matrix both times with values from 1 to 1e-300.
The second plot looks like that
If I combine them it looks like that
What I would like to see is still the colours of the second plot just overlayed with the black "circles" from the first plot. But somehow the colors from the second plot are lost. I use this approach:
Do you have any ideas how to make the final plot look better?
Thank you very much
P.S.> I am a MATLAB noob :) and I am using Matlab R2013a

Accepted Answer

Walter Roberson
Walter Roberson on 30 Oct 2015
With values as small as 1e-300 and at most 1 (both plus noise), log() of the values can be as low as -690 and as high as 0 (plus noise)
Then you combine that with a plot of values between 1 and 1e-300, so your combined plot has a data value range between -690 and +1. That change of range is going to change which values map to which color, as you have not given a caxis() command to determine the range of data used for coloring.
What I recommend you do is plot the color one first (which I think is actually the first of the two plots, not the second) and then call upon the File Exchange contribution named "freezeColors". That will lock in the colors for it. Then plot your black and white unfilled contours on top.
  1 Comment
jan mischke
jan mischke on 1 Nov 2015
Edited: jan mischke on 1 Nov 2015
I don't really know what this File Exchange means. I downloaded the file and unzipped it. Now I got several .m files. Do I copy the content into my script? The problem is that in the end I need to invoke my Matlab script with a main.c. So I need to automate the plots. So opening different script would not be the best solutions. Is there any better way without this freezeColor? I can update to R2014b if there is a better solution in that version. I found something http://www.mathworks.com/help/matlab/ref/patch-properties.html which could maybe help me with my problem but I really dont understand anything written there. Whats a Face etc...?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!