Smoothing two Histogram on the same figure for an article
1 view (last 30 days)
Show older comments
Hi friends,
I'm starting using matlab for my thesis.
I have two vectors [x] and [y].
I want them to be displayed as the attached image.
thanks :)
2 Comments
Roger J
on 20 Jul 2020
At the command prompt type F1, then click "Open Help Browser" link.
In the help browser on the top right, type "plot" into the Search Documentation box.
"plot - 2-D line plot" is what you are looking for.
Select that, and scroll down to "Plot Multiple Lines" section.
t = linspace(-.5,.5, numel(x)) % this will be the horizontal axis in your picture
figure
plot(t,x,t,y) % this will plot x and y vs. t, and assumes x&y have the same number of elements
You will also find on that page, how to add labels to the axis, and how to add a legend.
Answers (0)
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!