rotate my countour plot without changing the axes

조회 수: 8 (최근 30일)
Ernest Adisi
Ernest Adisi 2018년 8월 9일
댓글: Ameer Hamza 2018년 8월 13일
I have this plot which is fine, although, I want to rotate it 180 degrees; I tried the rotate function but get the following.
Error using rotate (line 33) H must contain axes children only.
i don't understand it. this was what i coded
Vq=griddata(x{1}(:),y{1}(:),V_m(:),X,Y);
[X,Y]=meshgrid(0:0.001:max(x{1}(:)),0:0.001:max(y{1}(:)));
f1=figure;
h=contourf(X,Y,Vq)
xlabel({'x(m)'})
ylabel({'y(m)'})
title('V-mean velocity profile')
hcb= colorbar;
title(hcb,'Velocity[m/s]')
rotate(h,[0 0 1],180)
Does anyone know how to rotate a contour plot without changing the axes please?

채택된 답변

Ameer Hamza
Ameer Hamza 2018년 8월 9일
rotate() function documentation does not include contour objects for rotation. However, for 180-degree rotation, the following will work
contourf(rot90(Z, 2));
  댓글 수: 2
Ernest Adisi
Ernest Adisi 2018년 8월 13일
can you show me how I include that code for my plot with contourf(X,Y,Vq)please
Ameer Hamza
Ameer Hamza 2018년 8월 13일
Try this
contourf(X,Y,rot90(Vq, 2));

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2018년 8월 9일
You can create a hgtransform group, parent the contour plot to it, and use makehgtform to create a transformation matrix that you can apply to the hgtransform group.

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by