Curve fitting & Plotting On Logarithmic y, linear x

12 ビュー (過去 30 日間)
ADSW121365
ADSW121365 2019 年 4 月 12 日
編集済み: Matt J 2019 年 4 月 15 日
I have a plot which looks something like this;
Capture.PNG
Which is a pretty nice plot upon which I'd like to curvefit. Within the curvefitting toolbox I can either input the data as plotted here, however the y axis remains linear giving me a horrible plot;
Capture2.PNG
And means the curvefitting is wrong. The next option is to input log(Ydata) which allows me curvefit to the dataset as I'm interested in it (note these are meaningless sample plots);Capture3.PNG
The issue being my yaxis is then effectively meaningless data. What I effectively wish to do is have the curvefit seen last plotted with the y axis from the first plot.
Can anyone help?

採用された回答

Matt J
Matt J 2019 年 4 月 12 日
編集済み: Matt J 2019 年 4 月 12 日
You can change the scale of the plot from linear to log just by doing
hAx.YScale='log';
where hAx is a handle to your axis.
  2 件のコメント
ADSW121365
ADSW121365 2019 年 4 月 15 日
This doesn't do anything to the plot window within the curve fitting toolbox which is where I need to change the yaxis.
I have unlogged y data which I wish to display against a log scale and then curvefit to. Most other options require logging the ydata before entry to curvefitting which then gives me a meaningless yscale on my actual plot or fitting to unlogged y data, outputting to a plot and then changing the yscale but of course the fit then doesn't match the data anymore
Matt J
Matt J 2019 年 4 月 15 日
編集済み: Matt J 2019 年 4 月 15 日
Well, that is a nuisance, but you can re-open the plot in a separate window (use the drop-down menu option File>Print to Figure). There, you will have full control over the axes scales, and can adjust YScale as in my original answer.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by