forked from chebfun/chebfun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheb2logo.m
109 lines (83 loc) · 2.69 KB
/
cheb2logo.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
function varargout = cheb2logo
%CHEB2LOGO The unofficial Chebfun2 logo.
% CHEB2LOGO plots the Chebfun2 logo.
%
% H = CHEB2LOGO returns a figure handle to the logo.
%
% See also CHEBLOGO.
% Copyright 2017 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.
% TODO: Comment this file.
LW = 'LineWidth';
FS = 'FontSize';
dom = [-1 0.957];
figure();
f = restrict(chebpoly(10), dom);
plot(f, LW, 5);
hold on
t = -cos(pi*(2:8)'/10)*0.99; % Chebyshev extrema (tweaked).
y = 0*t;
h = text(t, y, num2cell(transpose('chebfun')), FS, 28, ...
'hor', 'cen', 'vert', 'mid');
axis([-1.02 1.2 -1.5 3])
x = chebfun('x', dom);
plot(x + .2, f + 2, LW, 5)
hold on
f2 = f + 2;
x2 = x + .2;
xx = linspace(dom(1), dom(2), 1000).';
ff = [f(xx) f2(xx)];
close all
surf(repmat([0 1], length(xx), 1), -[xx xx], ff)
shading interp
colormap winter
fs = 18;
h1 = text(y, -t, num2cell(transpose('chebfun')), FS, fs, ...
'hor', 'cen', 'vert', 'mid') ;
set(gca, 'view', [ -74.500000000000000 -32.000000000000000]);
t = linspace(t(1), t(end), length(t));
h2 = text(.5*(t + 1) - .05, -y - .98, (t + 1) - .23, ...
num2cell(transpose('')), FS, fs, 'hor', 'cen', 'vert', 'mid', ...
'Rotation', 10);
t = t(2:4);
h3 = text(.5*(t + 1) - .02, -y(1:3) - 1, (t + 1) + .028, ...
num2cell(transpose('two')), FS, fs, 'hor', 'cen', 'vert', 'mid', ...
'Rotation',10);
set(gca, 'view', [-72.5000 -20.0000]);
axis off
set(gcf, 'color', 'w');
set(gca, 'pos', [0 0 1 1]);
hold on
C = [0.2 0.2 1];
lw = 3;
plot3(0*xx, -xx, f(xx), LW, lw, 'Color', C)
plot3(0*xx + 1, -xx, f2(xx), 'b', LW, lw, 'Color', C)
plot3([0 1], -dom(2)*[1 1], f(xx(end)) + [0 2], 'b', LW, lw, 'Color', C)
plot3([0 1], [1 1], [1 3], 'b', LW, lw, 'Color', C)
colormap([1 1 1 ; .5 .5 .5]);
flist = listfonts;
k = strmatch('Rockwell', flist); % 1st choice
if ( ~isempty(k) )
set(h1, 'fontname', flist{k(1)})
set(h2, 'fontname', flist{k(1)})
set(h3, 'fontname', flist{k(1)})
end
set(gca, 'xlim', [-.1 1])
set(gcf, 'position', [440 480 560 240]);
oldscreenunits = get(gcf, 'Units');
oldpaperunits = get(gcf, 'PaperUnits');
oldpaperpos = get(gcf, 'PaperPosition');
set(gcf, 'Units', 'pixels');
scrpos = get(gcf, 'Position');
newpos = scrpos/100;
set(gcf, 'PaperUnits', 'inches', 'PaperPosition', newpos);
% print -dpng andbeyond_white
drawnow
set(gcf, 'Units', oldscreenunits, 'PaperUnits', oldpaperunits, ...
'PaperPosition', oldpaperpos)
set(gcf, 'unit', 'cent', 'menuBar', 'none', ...
'name', 'Chebfun2 logo', 'numbertitle', 'off', 'color', 'w')
if ( nargout == 1 )
varargout = {h};
end
end