xlim is not working
47 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to use xlim to limit my x-axis
h_to_plot = linspace(1,20,20);
horizon = 1:1:20;
quant = 1.64;
mat = [coefficients ses [1:1:20]'];
[~,idx] = sort(mat(:,1));
sortedmat = mat(idx,:);
figure(3)
errorbar(horizon(h_to_plot),sortedmat(h_to_plot,1),quant*sortedmat(h_to_plot,2),'o','Linewidth',2)
hold on
xlim = ([0 20.5])
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/822980/image.png)
However, I could not make x-axis starts from 0 to 20.5
Is there any way I could use xlim to extend my x axis to 20.5?
Thanks
0 个评论
采纳的回答
VBBV
2021-12-3
xlim([0 20.5]) % difference
Difference in using and = between the xlim and parenthesis
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!