Error using 'YLim' for NEGATIVE Values (in plot\gca\YLim)
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
Please assist in getting below issue resolved.
We intend to define NEGATIVE values in Ylim parameter in gca for plotting purpose.
Sincerely,
A
*> A. TASK:*
1. Plot NEGATIVE VALUES ranging from -50 to -30. (-50 : -30)
2. In plotted figure, Demonstrate Y-Axis range from (-60 : -10)
*> B. ERROR:*
When YLim is used, following error is received:
"
Subscript indices must either be real positive integers or logicals.
Error in YTickIssue (line 11)
ax1.YLim([-60 -20]); "
*> C. CODE:*
"
x = [1:1:5];
y = [-36,-32,-46,-35,-37];
plot(x,y);
ax1 = gca;
ax1.YLim([-60 -20]);
"
0 commentaires
Réponses (1)
Star Strider
le 9 Juin 2016
That is not the correct way to set the YLim property.
Try this instead:
ax1.YLim = [-60 -20];
0 commentaires
Voir également
Catégories
En savoir plus sur Audio I/O and Waveform Generation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!