Scroll through 1 dimension of plotted Array in one figure
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:
<https://de.mathworks.com/matlabcentral/answers/304335-how-can-i-use-up-and-down-arrow-keys-to-scroll-through-my-plots-in-matlab-similar-to-a-query-on-21 Solution form this forum>
Thanks n advance!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:
<https://de.mathworks.com/matlabcentral/answers/304335-how-can-i-use-up-and-down-arrow-keys-to-scroll-through-my-plots-in-matlab-similar-to-a-query-on-21 Solution form this forum>
Thanks n advance! 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:
<https://de.mathworks.com/matlabcentral/answers/304335-how-can-i-use-up-and-down-arrow-keys-to-scroll-through-my-plots-in-matlab-similar-to-a-query-on-21 Solution form this forum>
Thanks n advance! matlab plots scrolling bacwards and forwards MATLAB Answers — New Questions