I want to rescale a contourf plot when I zoom in and out
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Lighting, Transparency, and Shading in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!