Plotting four positive quadrants
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Raïsa Roeplal
am 20 Apr. 2022
Beantwortet: Cris LaPierre
am 20 Apr. 2022
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?

0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 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';
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!