Multiple axis scales with contourf function

조회 수: 2 (최근 30일)
AB
AB 2014년 3월 6일
편집: AB 2014년 5월 12일
As you can see in the following plot, I made an efficiency map of a hydraulic pump. The efficiency is related to the input torque and speed of the shaft (mechanical), but also to the pressure and flow of the output (hydraulic).
So the two plots are practicly the same. Is it possible for a contour plot to have 4 axis?
Two x-axis (my flow and speed) with two y-axis (my torque and pressure)
I have calculated the correlation, the only problem seems to be that the scaling of the two axis will be different.
For the plotting I used 5 matrices: Torque, Pressure, Flow, Speed, Efficiency
Then I plotted them with:
contourf(Q,P,Eff,'showtext','on','levelstepmode','manual','levelstep', 1)
contourf(N,T,Eff,'showtext','on','levelstepmode','manual','levelstep', 1)
  댓글 수: 1
Patrik Ek
Patrik Ek 2014년 3월 6일
I guess nothing stops you from typing something like, 'T[Nm], P[bar]'. However, I would not recommend sharing axis here if it is not something that is always the same, because a plot like that would give such an impression. And if they are always the same I would rather show it once with 2 plots and then only show one property.

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

채택된 답변

Patrik Ek
Patrik Ek 2014년 3월 7일
Ok try this,
a = 1:5;
b = 2:2:10;
plot(a,b)
ax1 = gca;
ax2 = axes('Position',get(ax1,'Position'),'XAxisLocation','top',...¨
'YAxisLocation','right','Color','none','XColor','r','YColor','b');
When you are going to label the axis then, you have to give the correct handle for each axis (ax1 and ax2 in this case).

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by