-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathcreatefigure.m
28 lines (22 loc) · 853 Bytes
/
createfigure.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function createfigure(X1, YMatrix1)
%CREATEFIGURE(X1,YMATRIX1)
% X1: vector of x data
% YMATRIX1: matrix of y data
% Auto-generated by MATLAB on 04-Oct-2016 10:05:26
% Create figure
figure1 = figure;
% Create axes
axes1 = axes('Parent',figure1);
box(axes1,'on');
hold(axes1,'all');
% Create multiple lines using matrix input to plot
plot1 = plot(X1,YMatrix1,'Parent',axes1,'LineWidth',2);
set(plot1(1),'DisplayName','My fantastic sine curve','Color',[0 0 0]);
set(plot1(2),'LineStyle','--','Color',[1 0 0],...
'DisplayName','My fantastic cosine curve');
set(plot1(3),'LineStyle',':','Color',[0 0 1],...
'DisplayName','My even more fantastic cosine curve');
% Create legend
legend1 = legend(axes1,'show');
set(legend1,'Interpreter','latex',...
'Position',[0.456696428571428 0.111904761904762 0.459821428571429 0.186309523809524]);