I want to rescale a contourf plot when I zoom in and out
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ok, I will do my best to describe this. I have a matrix that I've plotted using a contour plot. The matrix is very feature rich, lots of peaks and troughs. However, The first and last few rows of the matrix are excessively large. Therefore most of the feature in the middle become hidden because the contours are so big to compensate.
I would like to attach some code to the zoom feature of the figure to rescale the contours after I have zoomed in/out on the figure, to only scale for what is currently being shown. This is how far I have got:
figure;
contourf(thisSec')
g = colorbar;
h = zoom;
h.ActionPostCallback = 'rescale(thisSec)';
Where my rescale function is currently:
function [] = rescale(myData)
Xlimits = round(get(gca,'XLim'));
Ylimits = round(get(gca,'YLim'));
thisData = myData(Xlimits(1):Xlimits(2),Ylimits(1):Ylimits(2));
maxData = max(max(thisData));
minData = min(min(thisData));
caxis([minData maxData]);
This does something to the colormap, but not exactly what I'm after. It doesn't show anymore features as I zoom in, but it does recolor things.
Can anyone help me with this please?
Thanks
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!