How can I generate equal visual witdh bars with bar graph and log absciss scale ?

8 ビュー (過去 30 日間)
Damien MORIN
Damien MORIN 2019 年 6 月 19 日
回答済み: Roman Katzer 2024 年 2 月 20 日
Hello everyone,
My problem is that I want to obtain a graph similar to this one (consider the green bars only) with Matlab.
The things is that with a logarithmic absciss scale with Matlab, I obtain:
Is there a way to generate bars with a width that increase when this bar is located on the right of the absciss scale in order to hev "visualy" the same width for each bar ?
Regards
N.B : I put my code as an attached file but it is quite simple.

採用された回答

G A
G A 2019 年 7 月 20 日
編集済み: G A 2019 年 7 月 20 日
Instead of making the x-scale logarithmic by set(gca, 'xscale','log'), use linear x-scale and log10(Frequency) as X

その他の回答 (1 件)

Roman Katzer
Roman Katzer 2024 年 2 月 20 日
I used the stairs plot function with specified band edges. Code is attached.
What I don't know is why the fractional spectra from poctave would be different, depending on whether I calculate them from time signal os the time signal's PSD. If anyone has an idea, please help.
noise spectra
sine spectra

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by