Plotting four positive quadrants

8 views (last 30 days)
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?

Accepted Answer

Cris LaPierre
Cris LaPierre on 20 Apr 2022
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';

More Answers (0)

Community Treasure Hunt

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

Start Hunting!