如何绘制两个方向的x轴

 Risposta accettata

Voss
Voss il 18 Mar 2022

0 voti

If I understand what you want to do, you can try something like this:
plot(-4:4,-4:4);
ax = gca();
set(ax,'XTickLabels',abs(get(ax,'XTick')));
Note that you would also have to update the XTickLabels whenever the XTicks change, e.g., when zooming or panning or potentially when the axes changes size.

2 Commenti

weihan wang
weihan wang il 18 Mar 2022
thank you very much!
Voss
Voss il 18 Mar 2022
You're welcome!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su 图形对象属性 in Centro assistenza e File Exchange

Richiesto:

il 18 Mar 2022

Commentato:

il 18 Mar 2022

Community Treasure Hunt

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

Start Hunting!