How to plot vertical line from X Axis to values on graph?
6 views (last 30 days)
Show older comments
ImperialStar
on 28 Dec 2019
Commented: Star Strider
on 28 Dec 2019
Hi,
Ive got a fft plot with values linked by a line however, I would like the values to be plotted as a straight vertical line down to the x axis so that it just shows each frequency. I havent been able to find a possible way of doing this anywhere. Help on how to do this is very much appreciated.
0 Comments
Accepted Answer
Star Strider
on 28 Dec 2019
Example —
f = 0:0.05:pi; % Create Frequency Vector
A = rand(size(f)); % Create Fourier Transform Amplitude Vector
figure
plot(f, A, '-b')
hold on
stem(f, A, '-r', 'Marker','none') % Plot ‘stem’ Without Markers
hold off
grid
This plots the Fourier transform amplitudes with a blue line, and with red stem lines. Change the various properties to get the result you want.
2 Comments
More Answers (0)
See Also
Categories
Find more on Title 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!