Scroll through 1 dimension of plotted Array in one figure
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear all i want to plot the Data in an array and overlay a vektor plot with quiver the Array for the main plot has the deimension 167x176x2000. Two additional Arrays of the same size contain the information for the quiver overlay. I do display the data as XY plots at a givven z value. Obviously i do not want to store 2000 Images. Instead i want a plot, were i can scroll through the 3d dimension of my Array either with the mouse wheel or up and down arrows. The values for the quiver need to be updated as well.
Here is my code wich currently only displays the last image.
quiver_factor=1000000000; %factor to increase the arrows on the quiver images WAS 100 BEFORE
colorscale=0.3; %max abs lateral force in nN. % 0.12 fo const Fz % ORIGINALLY 0.12
for k=1:size(Main_array,3)
clear imagex imagey
[X,Y]=meshgrid(1:size(2nd_array,1),1:size(2nd_array,2));
imagex(:,:)=2nd_array(:,:,k);
imagex=imagex'*quiver_factor;
imagey(:,:)=3nd_array(:,:,k);
imagey=imagey'*quiver_factor;
image_F=Main_array(:,:,k)';
contourf(X,Y,image_F, 512, 'LineColor', 'none');
colormap(hsv(1024));
hold on
quiver(X,Y,imagex,imagey);
hold off
end
I found the follwing link, but could make the solution work with my code:
Thanks n advance!
0 commentaires
Réponses (1)
Vladimir Golkov
le 13 Juin 2024
In your case, you can use it as follows:
scroll(Main_array)
0 commentaires
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!