Plotting four positive quadrants

조회 수: 21 (최근 30일)
Raïsa Roeplal
Raïsa Roeplal 2022년 4월 20일
답변: Cris LaPierre 2022년 4월 20일
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