Multiple axis scales with contourf function

2 次查看(过去 30 天)
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