Add Trendline to gplotmatrix
1 view (last 30 days)
Show older comments
How can I add basic trendlines to a gplotmatrix? I compile a large amount of data ending up in a 10x10 scatter plot matrix and I'd like each of those to have a trendline.
if true
Data_Excel = paste; %Using Copy/Paste tool put
Data=Data_Excel(2:end,1:end); %input data from excel in data array
legend=Data_Excel(1,1:end); %take header files for legend
figure
% Changed to use 'cell2float' function, this allows you to put NAN or blank
% spaces in your data set. Useful if you have outlier data points you don't
% have to hide the whole data set, just delete the specific outlier data
% variable
[h,ax,BigAx]=gplotmatrix(cell2float(Data),[],cell2float(Data(:,1)),distinguishable_colors(25),'xxxxxxx',4, ...
'on','variable',regexprep(legend,'_',' '),regexprep(legend,'_',' ')'); %Plot a series of scatter plots, plots will be generated based on number of Excel columun headers were used
end
0 Comments
Answers (0)
See Also
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!