How can I improve my plots including a dashed line
3 ビュー (過去 30 日間)
古いコメントを表示
Hello, I am developing a code where I need to create a plot that incorporates fitted values on a semi-logarithmic scale on the x-axis, but I also need to insert a dashed line in the center of the plot (when y = 0). I am attaching an example of how I am doing it, but the line is not being displayed in the figure.
figure
semilogx(data_resi_inter.PGA1100,delta_ij_inter,'^r');
hold on
plot([0 0.6],[0 0],'k--','LineWidth',1.0) % dashed line
title('Delta term vs PGA1100');
subtitle('for Interface EQs & T = PGA');
ylabel('Delta_{ij}');
xlabel('PGA1100 [g]');
grid on
On the other hand, I would like to know if there is a way to make all the figures (which in my case are 6 of the same type) appear on the screen at the same time, without having to close one to see the next.
I have already used the 'subplot' function, but I also need to use the 'print' command, and the figures are not saved with sufficient quality for proper viewing.
0 件のコメント
採用された回答
Walter Roberson
2024 年 10 月 16 日
semilogx(data_resi_inter.PGA1100,delta_ij_inter,'^r');
The x axis is being set to log.
plot([0 0.6],[0 0],'k--','LineWidth',1.0) % dashed line
You ask to plot starting from 0 on a log x axis. That is an implicit request to plot from -infinity (log(0) == -infinity). No line will be drawn when a coordinate is nan or inf.
You need to start your plot from a positive real coordinate.
8 件のコメント
Sam Chak
2024 年 10 月 17 日
Hi @Ivan
You can learn more in the documentation of ylabel():
However, plotting error bars is uncommon in my field, as most phenomena can be modeled with deterministic mathematical equations, provided they align with the governing equations of physics. Therefore, insignificant errors are often neglected, as they typically do not pose a threat to human safety or asset value. Moreover, there are predictive and corrective algorithms available as backups.
Have you not found any information about error bars on mathworks.com?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!