MATLAB: Does generated code from cftool produce a different looking graph than cftool

cftoolcodecolorCurve Fitting Toolboxdifferentfiguregenerateview

Why does generated code from cftool produce a different looking graph than cftool?
When I make a figure using the cftool and then generate code and make a figure using the same data, the figure looks slightly different in terms of coloring and view.
I like the cftool figure better, how can I get this behavior?

Best Answer

After generating code from cftool, here are a couple properties you can change to get the plots to be more similar:
>> f = gcf;
>> a = gca;
>> L = a.Children(1);
>> S = a.Children(2);
>> L.MarkerFaceColor = 'k';
>> L.MarkerEdgeColor = [0 0 0];
>> L.MarkerSize = 3;
>> S.EdgeColor = [0 0 0];
>> S.EdgeAlpha = .3;
>> f.Position = [f.Position(1:2) 1008 520];
>> a.View = [-37.5 30];
Note: Running the code above does not give an exact replica of the cftool figure. To find the exact same figure, follow the following steps:
- Create the desired figure in cftool
- File -> Print to figure
- Then compare the properties of this figure and the generated code figure to find all the differences