y-axis only absolute values
Mostra commenti meno recenti
Hi folks,
Is there a easy way to set the y-axis values to their absolute values such that there are only positive numbers on the y-axis?
Thank you for answers,
Cheers Sam
1 Commento
José-Luis
il 13 Giu 2014
What do you want to do about the negative values in your plot? Just not show them?
Risposte (2)
dpb
il 13 Giu 2014
Sure,
plot(x,abs(y))
I'm guessing that's not what you mean, precisely, however. If you mean instead to simply display abs() of tick labels even if the y-limits include some negatives, then try
set(gca,'yticklabel',num2str(abs(get(gca,'ytick').')))
Azzi Abdelmalek
il 13 Giu 2014
yl=get(gca,'ylim')
ylim([0 max(yl)])
Categorie
Scopri di più su Axis Labels in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!