Plotting four positive quadrants
20 ビュー (過去 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?

0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
