Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Line Width of Plot of Fit in Matlab

I'd like to change the width of my fit plot along the lines of:

plot(fit, 'LineWidth', WidthSpec)

Unfortunately, when I try plotting the data and fit simultaneously like:

plot(fit, 'LineWidth', WidthSpec, XData, YData)

I get an error message saying

??? Error using ==> cfit.plot at 52
EXCLUDEDATA has greater length than XDATA.

Plotting both without specification of the width like

plot(fit, XData, YData) 

works just fine.

like image 946
lhcgeneva Avatar asked Jan 13 '23 11:01

lhcgeneva


1 Answers

Try to store the returned handle and adjust the width using that:

h = plot(fit, ...);
set(h, 'LineWidth',2)
like image 148
Amro Avatar answered Jan 21 '23 05:01

Amro