How can I add error bars to my scatter plot if I only have a .fig file.

10 次查看(过去 30 天)
I have imported data from an excel sheet, x and y values and their respective errors. How can I plot a scatter graph with error bars? I have used the plot/figure editor and its property inspector to customize my graph, but I cannot add the error bars to it. I know that I can use:
errorbar(x_err, y_err, 'LineStyle','none');
But I don't have where to write it. When I use the "generate function" option from the editor, I receive a number of errors and my graph doesn't appear the same as in the editor. Is there any way I can use the graph that I customized in the editor, or do I need to make a new plot by writing a script?

采纳的回答

dpb
dpb 2021-12-4
If the figure is the current one, then
hAx=gca; % get handle to current axes
hold on % add to gca
errorbar(hAx,x_err,y_err,'LineStyle','none') % the hAx is superfluous if is gca, but can't hurt

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by