【问题标题】:plotting coordinates with error bars in matlab在matlab中用误差线绘制坐标
【发布时间】:2019-11-17 23:58:20
【问题描述】:
X=[5987324.35399918,
   5987324.35399915,
   5987324.35399905,
   5987324.35399913,
   5987324.35399903,
   5987324.35399901,
   5987324.3539991,
   5987324.35399901,
   5987324.35399898,
   5987324.35399896];
Y=[6764823.56000006,
   6764823.56000007,
   6764823.56000007,
   6764823.56000007,
   6764823.56000008,
   6764823.56000008,
   6764823.56000007,
   6764823.56000008,
   6764823.56000008,
   6764823.56000008];

% Graphical representation of error bar with coordinates
figure
err_x1=[5.9090 5.9090 5.9090 5.9090 5.9090 5.9090 5.9090 5.9090 5.9090 5.9090];
err_y1=[5.9090 5.9090 5.9090 5.9090 5.9090 5.9090 5.9090 5.9090 5.9090 5.9090];
errorbar(X,Y,err_x1,err_y1,'o')
scatter(X, Y,100,'k');
set(gca,'FontSize',10,'xscale','log','yscale','log');

无法获取图表。 X 和 Y 以米为单位,err_x1 和 err_y1 以毫克为单位。

【问题讨论】:

  • 问题是什么?你不能得到图表,你为什么这么说?您的代码的输出是什么,预期的输出是什么?请阅读minimal reproducible example
  • 我没有得到误差线只是坐标。
  • 可能是数字大小的问题。但首先尝试在figure 语句之后和scatter 语句之前的某处添加hold on
  • 耶。它现在工作。谢谢

标签: matlab plot errorbar


【解决方案1】:

正如 Cris Luengo 在 cmets 中所说,您错过了 hold on 的声明,因此 scatter 的调用替换了 errorbar 的第一个调用。在两者之间添加hold on;即可解决问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-14
    • 2018-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多