forked from bastientalgorn/plotwithmarkers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_plotwithmarkers.m
126 lines (74 loc) · 2.73 KB
/
example_plotwithmarkers.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
close all
clear all
disp('==== test_export_fig.m ======');
figure('color','white','position',[100 100 800 800]);
subplot(2,2,1);
hold on;
x = (0:0.01:1);
nbMarkers = 11;
f1 = x;
pointeur(1) = plotwithmarkers(x,f1,nbMarkers,'-or','linewidth',1);
legendText{1} = '$y=x$';
f2 = x+0.1*x.^2;
pointeur(2) = plotwithmarkers(x,f2,nbMarkers,'--pb','linewidth',2);
legendText{2} = 'My Curve';
f3 = sqrt(x);
pointeur(3) = plotwithmarkers(x,f3,nbMarkers,'-vg','linewidth',1);
legendText{3} = '$y=\sqrt{x}$';
xlabel('Standard utilisation of plotwithmarkers');
legend(pointeur,legendText,...
'location','northwest',...
'interpreter','latex')
subplot(2,2,2);
hold on;
x = (1/1.5).^(0:30);
nbMarkers = 11;
f1 = log(x).*sqrt(x);
pointeur(1) = plotwithmarkers(x,f1,nbMarkers,'logscale','random',0.8,'-or','markersize',10);
legendText{1} = '$log(x)\sqrt{x}$';
f2 = log(x).*x;
pointeur(2) = plotwithmarkers(x,f2,nbMarkers,'logscale','random',0.8,'--pb','markersize',10);
legendText{2} = '$log(x)\times x$';
f3 = sqrt(x);
pointeur(3) = plotwithmarkers(x,f3,nbMarkers,'logscale','random',0.8,'-vg','markersize',10);
legendText{3} = '$\sqrt{x}$';
set(gca,'xscale','log');
xlabel('A little bit of randomness in the position of the markers\newline{}Options : logscale + random 0.8');
legend(pointeur,legendText,...
'location','northwest',...
'interpreter','latex')
subplot(2,2,3);
hold on;
x = (0:0.01:1);
nbMarkers = 11;
f1 = x;
pointeur(1) = plotwithmarkers(x,f1,nbMarkers,'-or','offset',0/3,'markersize',8);
legendText{1} = '$y=x$';
f2 = x+0.1*x.^2;
pointeur(2) = plotwithmarkers(x,f2,nbMarkers,'--pb','offset',1/3,'markersize',8);
legendText{2} = 'My Curve';
f3 = x+0.1*sqrt(x);
pointeur(3) = plotwithmarkers(x,f3,nbMarkers,'-vg','offset',2/3,'markersize',8);
legendText{3} = '$y=\sqrt{x}$';
xlabel('Small shifts of the markers with the option "offset"');
legend(pointeur,legendText,...
'location','northwest',...
'interpreter','latex')
subplot(2,2,4);
hold on;
x = (1/1.5).^(0:30);
nbMarkers = 11;
f1 = log(x).*sqrt(x);
pointeur(1) = plotwithmarkers(x,f1,nbMarkers,'logscale','nicemarkers','linestyle','-','linewidth',1,'marker','o','color','r','markersize',10);
legendText{1} = '$log(x)\sqrt{x}$';
f2 = log(x).*x;
pointeur(2) = plotwithmarkers(x,f2,nbMarkers,'logscale','nicemarkers','linestyle','-','linewidth',1,'marker','p','color','b','markersize',10);
legendText{2} = '$log(x)\times x$';
f3 = sqrt(x);
pointeur(3) = plotwithmarkers(x,f3,nbMarkers,'logscale','nicemarkers','linestyle','-','linewidth',1,'marker','v','color','g','markersize',10);
legendText{3} = '$\sqrt{x}$';
set(gca,'xscale','log');
xlabel('Options : logscale + nicemarkers');
pl = legend(pointeur,legendText,...
'location','northwest',...
'interpreter','latex')