HI all,
I am new to matlab and I would like to write a code to create a plot similar to this one:
2020-01-06.png
Basically for each of my sample I have the data relative to the label in the x axis. Is there any way to create such a plot? I want to list those letters (La, Ce, Pr....) in the x axis and the corrisponding value in the Y axis (it is a semilog plot). Also I want to plot a vertical error bar! I have the data in an excel spreadsheet.
Thank you
A.

 Accepted Answer

Adam Danz
Adam Danz on 6 Jan 2020
Edited: Adam Danz on 7 Jan 2020
To plot the errorbars, use errorbar(x,y,neg,pos). Check out that link to get started (see examples within).
To specify the x axis ticks, follow this example
xlab = {'La','Ce', . . . , 'Lu'};
set(gca, 'XTick', 1:numel(xlab), 'XTickLabel', xlab)
% ^--axis handle
If you get stuck, show us your updated code and let us know where we can help.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!