フィルターのクリア

Plotting Multiple Linear Regressions

14 ビュー (過去 30 日間)
Jenny
Jenny 2016 年 8 月 8 日
回答済み: Jonathan Kwang 2016 年 8 月 11 日
Hello,
I've used the mdl = fitlm(x,y,'linear') function to fit a dataset, and I need to plot them all in one plot.
How do I change the format of the graph layout, for instance, I want to hide the confidence bounds. I couldn't find any info in the documentation.
Kind regards, Jenny

回答 (1 件)

Jonathan Kwang
Jonathan Kwang 2016 年 8 月 11 日
I understand that you would like to know how to customize the appearance of the graph layout after plotting a linear regression model.
The following example fits a linear regression model and shows how you can access and modify the graphics handles returned when plotting the linear model.
>> load hald % load dataset
>> lm = fitlm(ingredients,heat)
>> h = plot(lm) % plot the linear model
>> confidenceLineHandle = h(3) % The confidence bounds line handle is the third element in the array.
>> confidenceLineHandle.Visible='off' % Hides the confidence bounds from the graph.
You can also refer to the following documentation page to learn more about "Chart Line Properties" and how to modify them. http://www.mathworks.com/help/matlab/ref/chartline-properties.html

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by