Contourf isoline in logarictmic scale

3 views (last 30 days)
Lukas Cierny
Lukas Cierny on 24 Jun 2019
Answered: Lukas Cierny on 25 Jun 2019
Hi, I would like to ask you for an advice or solution of my problem... I have data X,Y and Z. I want to use the function CONTOURF for 2D contour plots, but I'd like to have data Z in logaritmic scale. I figured it out by CLABEL (picture no.1), but I'd like to wish the labels of contours looked like in the picture no.2 . Is there any solution?
pic.1
pic1.JPG
pic.2
pic2.JPG

Answers (1)

Lukas Cierny
Lukas Cierny on 25 Jun 2019
Hi evryone, I have finally figured out this problem...Example is below..
x = 0:0.1:10;
y = 0:0.1:10;
[X,Y] = meshgrid(x,y);
Z = exp(X) + exp(Y);
figure
[~,h] = contourf(X,Y,log2(Z),10,'ShowText','on');
levels = h.LevelList;
colorbar
figure
[c,h] = contourf(X,Y,Z,pow2(levels),'ShowText','on', 'PickableParts','none');
ax = gca;
ax.ColorScale = 'log';
colorbar

Categories

Find more on Contour Plots in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!