Generated Code from plot
Show older comments
How to implement the generated code from the plot inspector?
Code:
function createfigure6(X1, Y1, X2, Y2, X3, Y3, X4, YMatrix1, X5, Y4, X6, YMatrix2)
%CREATEFIGURE6(X1, Y1, X2, Y2, X3, Y3, X4, YMatrix1, X5, Y4, X6, YMatrix2)
% X1: vector of x data
% Y1: vector of y data
% X2: vector of x data
% Y2: vector of y data
% X3: vector of x data
% Y3: vector of y data
% X4: vector of x data
% YMATRIX1: matrix of y data
% X5: vector of x data
% Y4: vector of y data
% X6: vector of x data
% YMATRIX2: matrix of y data
% Auto-generated by MATLAB on 14-Nov-2020 12:23:36
% Create figure
figure1 = figure('WindowState','maximized');
% Create axes
axes1 = axes('Parent',figure1);
hold(axes1,'on');
% Create plot
plot(X1,Y1,'DisplayName','All Datapoints Set 1','Marker','.',...
'LineStyle','none',...
'Color',[0.8 0.79 0.79]);
% Create plot
plot(X2,Y2,'DisplayName','All Datapoints Set 2','Marker','.',...
'LineStyle','none',...
'Color',[0.8 0.79 0.79]);
% Create plot
plot(X3,Y3,'DisplayName','Datapoints Set 1','Marker','.','LineStyle','none',...
'Color',[0.529411764705882 0.709803921568627 0.980392156862745]);
% Create multiple lines using matrix input to plot
plot1 = plot(X4,YMatrix1,'DisplayName','Mean Fit-Error Set 1',...
'PickableParts','none',...
'HitTest','off',...
'LineWidth',1.5,...
'Color',[0.011764705882353 0.27843137254902 0.701960784313725],...
'Parent',axes1,...
'AlignVertexCenters','on',...
'LineStyle','--');
set(plot1(1),'DisplayName','Datapoints Set 1','LineWidth',2,...
'AlignVertexCenters','off',...
'LineStyle','-');
set(plot1(3),'MarkerFaceColor','auto');
% Create plot
plot(X5,Y4,'DisplayName','Datapoints Set 2','MarkerFaceColor','auto',...
'Marker','.',...
'LineStyle','none',...
'Color',[0.980392156862745 0.388235294117647 0.388235294117647]);
% Create multiple lines using matrix input to plot
plot2 = plot(X6,YMatrix2,'DisplayName','Mean Fit-Error Set 2',...
'PickableParts','none',...
'HitTest','off',...
'LineWidth',1.5,...
'Color',[1 0 0],...
'Parent',axes1,...
'AlignVertexCenters','on',...
'LineStyle','--');
set(plot2(1),'DisplayName','Datapoints Set 2','LineWidth',2,...
'AlignVertexCenters','off',...
'LineStyle','-');
% Create ylabel
ylabel('Slipslide angel Beta[^0]','Interpreter','none');
% Create xlabel
xlabel('Lateral acceleration[m/s^2]','Interpreter','none');
box(axes1,'on');
% Create legend
legend1 = legend(axes1,'show');
set(legend1,'Location','best');
end
Accepted Answer
More Answers (0)
Categories
Find more on Semiconductors and Converters in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!