How to plot vertical line from X Axis to values on graph?
조회 수: 6 (최근 30일)
이전 댓글 표시
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
채택된 답변
Star Strider
2019년 12월 28일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Title에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!