Multiple axis scales with contourf function

2 Ansichten (letzte 30 Tage)
AB
AB am 6 Mär. 2014
Bearbeitet: AB am 12 Mai 2014
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 Kommentar
Patrik Ek
Patrik Ek am 6 Mär. 2014
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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Patrik Ek
Patrik Ek am 7 Mär. 2014
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).

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by