Plotting four positive quadrants

10 次查看(过去 30 天)
Dear Matlab community,
I am trying to plot the effect of two parameters on two different key perfromance indicators (KPI's), as shown in the attached sketch. The values assigned to all axes must be positive. So I need four positive quadrants in my graph. Can anyone suggest how to achieve this?

采纳的回答

Cris LaPierre
Cris LaPierre 2022-4-20
What is plotted vs what is used as a label can be different. I suggest plotting the negative of KPI(2) and Parameter2, but label the axis using positive values.
KPI1 = [0 0.125 0.25 0.5];
P1 = [0 0.5 1 2];
KPI2 = [0 0.07 0.125 0.375];
P2 = [0 0.5 1 2];
plot(P1,KPI1)
hold on
plot(P1,-KPI2)
plot(-P2,KPI1)
plot(-P2,-KPI2)
hold on
% Define axes ticks and labels
xticks([-3 -2 -1 0 1 2 3])
xticklabels([3 2 1 0 1 2 3])
yticks([-0.5 -0.25 0 0.25 0.5])
yticklabels([0.5 0.25 0 0.25 0.5])
axis([-3 3 -.75 .75])
% place axes at origin
ax = gca;
ax.XAxisLocation = 'origin';
ax.YAxisLocation = 'origin';

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by