How do I create a plot that is logscale in y and mixed log/linear scale in x?

2 ビュー (過去 30 日間)
David
David 2014 年 4 月 16 日
編集済み: dpb 2014 年 4 月 17 日
I am plotting a function on [0,180] that is nearly singular about 0. I want loglog over [0,10] and then semilogy over [10,180]. An example of the function is:
y=1/(1+2*k-cos(x)).^2;
where k is << 1.
  2 件のコメント
dpb
dpb 2014 年 4 月 16 日
Use
subplot(1,2)
to create two axes then adjust they're positions to fill in the space between, hiding the left y-axis on the RH axes. Set the two axes xlim property appropriately for the two ranges.
dpb
dpb 2014 年 4 月 16 日
編集済み: dpb 2014 年 4 月 17 日
Or, the other way would be to keep the one axes object but transform x>10 to log and set the ticks and labels manually.
In this case to plot on the same axis you would
plot(log10(x>10)+10,y(x>10))
to get the offset on the axis, of course.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeLog Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by