How do I make ZOOM in 2D graphics to detail specific areas?

조회 수: 1 (최근 30일)
Alex Valero Mora
Alex Valero Mora 2018년 9월 26일
답변: Adam Danz 2018년 9월 26일
Greetings in these situations (SEE 2D GRAPHICS IN THE IMAGE) I would like to apply a ZOOM to see in more detail a zone of the graph, that is to say a ZOOM separately inside the graph, could you help me with that doubt? I do not know how to do it. if they can observe, they will realize that within the black line there are 4 lines of graphics and i want to see that area in detail.
%-----------definition of variables--------------
function[] = GraficosIndices2D_M45_50(A_M45_50_pitch, B_M45_50_pitch, C_M45_50_pitch, D_M45_50_pitch, A_M45_50_IestPitch, B_M45_50_IestPitch, C_M45_50_IestPitch, D_M45_50_IestPitch, A_M45_50_IdirPitch, B_M45_50_IdirPitch, C_M45_50_IdirPitch, D_M45_50_IdirPitch, R_Iest, R_IestRoll, R_IestPitch, R_Idir, R_IdirPitch, R_IdirRoll, R_pitch, R_roll)
[X1,Y1]= meshgrid(R_pitch,R_roll);
%--------3D GRAFICS------------------------------ figure
%----------GRAFIC 3D 1----------
subplot (2,2,1);
surf(X1,Y1,R_Iest);
%axis([-30 30 -30 30 0.5 1])
set(gca,'Ydir','reverse')
set(gca,'Xdir','reverse')
ylabel ('Roll (°)');
xlabel ('Pitch (°)');
zlabel ('I_e_s_t');
title ('Rígido');
%----------GRAFIC 3D 2----------
subplot (2,2,3);
surf(X1,Y1,R_Idir);
%axis([-30 30 -30 30 0.5 1])
set(gca,'Ydir','reverse')
set(gca,'Xdir','reverse') xlim auto
ylim auto ylabel ('Roll (°)');
xlabel ('Pitch (°)'); zlabel ('I_d_i_r');
title ('Rígido');
%--------2D GRAFICS------------------------------
%----------GRAFIC 2D 1----------
subplot (2,2,2);
plot (A_M45_50_pitch,A_M45_50_IestPitch,'linewidth',2);
hold on
plot (B_M45_50_pitch,B_M45_50_IestPitch,'r','linewidth',2);
hold on
plot (C_M45_50_pitch,C_M45_50_IestPitch,'g','linewidth',2);
hold on
plot (D_M45_50_pitch,D_M45_50_IestPitch,'k','linewidth',2);
hold on
plot (R_pitch,R_IestPitch,'Color',[0.9290, 0.6940, 0.1250],'linewidth',2);
%axis([15 19 0.75 0.85]);
axis([15 19 0.59 0.85]);
ylabel ('I_e_s_t');
xlabel ('Pitch (°)');
title ('I_e_s_t para F_5_z = 50N, \theta_1 = -45°, Roll = 0º y k_w = 3017.15 N/mm');
grid on
legend ('K_s=10','K_s=19','K_s=39.07','K_s=55','Rígido');
%----------GRAFIC 2D 2----------
subplot (2,2,4);
plot (A_M45_50_pitch,A_M45_50_IdirPitch,'linewidth',2);
hold on
plot (B_M45_50_pitch,B_M45_50_IdirPitch,'r','linewidth',2);
hold on
plot (C_M45_50_pitch,C_M45_50_IdirPitch,'g','linewidth',2);
hold on
plot (D_M45_50_pitch,D_M45_50_IdirPitch,'k','linewidth',2);
hold on
plot (R_pitch,R_IdirPitch,'Color',[0.9290, 0.6940, 0.1250],'linewidth',2);
%axis([15 19 0.81 0.84]);
axis([15 19 0.59 0.85]);
ylabel ('I_d_i_r');
xlabel ('Pitch (°)');
title ('I_d_i_r para F_5_z = 50N, \theta_1 = -45°, Roll = 0º y k_w = 3017.15 N/mm');
grid on
legend ('K_s=10','K_s=19','K_s=39.07','K_s=55','Rígido');
end

답변 (1개)

Adam Danz
Adam Danz 2018년 9월 26일
Option 1: manually Use your mouse to zoom into parts of your plot.
Option 2: programmatically by setting the xlim() ylim() to the desired ranges.

카테고리

Help CenterFile Exchange에서 Data Exploration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by