Contour Plot Color Scaling
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a function dependant on variables A and B. I want to plot the values on a filled contour plot with A,B as the x,y axes.
The code is something like this:
A=[0:0.1:1];
B=[0:0.1:1];
figure
[X,Y]=meshgrid(A,B);
Z=function(A,B);
contourf(X,Y,Z);
colorbar;
Since the values of Z (the data) are from around -1 to +1 the contour plot is fine and can easily see the variations.
However setting the range of B (or A) to B=[0:0.01:1] as required to improve accuracy results in a few odd values being much larger (near 100) which completely skews the contour plot so I just end up with a red point there and everything else blue (indicating near zero) meaning I can no longer distinguish these small variations between most of the data points. The colorbar also indicates this new range linearly, as expected but not ideal.
I thought about taking log of the data? or just for Z? Something like:
figure
[X,Y]=meshgrid(A,B);
Z=function(A,B);
contourf(X,Y,log(Z));
colorbar;
But this gives me all sorts of errors. I don't know how to properly do this.
Is this the way to go to fix the issue? Or if not what's another way?
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Colormaps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!