How can I add error bars to my scatter plot if I only have a .fig file.
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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?
0 commentaires
Réponse acceptée
dpb
le 4 Déc 2021
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
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Object Properties 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!