global figure sizes and subplot adjust values
This commit is contained in:
parent
2a0e1adff8
commit
048bce0a20
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
\documentclass[12pt]{book}
|
\documentclass[12pt]{book}
|
||||||
|
|
||||||
\input{../../header}
|
\input{../../header}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
\usepackage{pslatex} % nice font for pdf file
|
\usepackage{pslatex} % nice font for pdf file
|
||||||
|
|
||||||
%%%% layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%% layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
\usepackage[left=25mm,right=25mm,top=20mm,bottom=30mm]{geometry}
|
\usepackage[a4paper,left=25mm,right=25mm,top=20mm,bottom=30mm]{geometry}
|
||||||
\usepackage[within=chapter]{newfloat}
|
\usepackage[within=chapter]{newfloat}
|
||||||
\usepackage{tocloft}
|
\usepackage{tocloft}
|
||||||
\setlength{\cftfigindent}{1.2em}
|
\setlength{\cftfigindent}{1.2em}
|
||||||
|
13
plotstyle.py
13
plotstyle.py
@ -1,7 +1,11 @@
|
|||||||
import matplotlib as mpl
|
import matplotlib as mpl
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
xkcd_style = False
|
xkcd_style = True
|
||||||
|
|
||||||
|
# default size of figure:
|
||||||
|
figure_width = 15.0 # cm, should be set according to \textwidth in the latex document
|
||||||
|
figure_height = 6.0 # cm, for a 1 x 2 figure
|
||||||
|
|
||||||
# colors:
|
# colors:
|
||||||
colors = {
|
colors = {
|
||||||
@ -133,6 +137,13 @@ else:
|
|||||||
mpl.rcParams['xtick.major.size'] = 2.5
|
mpl.rcParams['xtick.major.size'] = 2.5
|
||||||
mpl.rcParams['ytick.major.size'] = 2.5
|
mpl.rcParams['ytick.major.size'] = 2.5
|
||||||
mpl.rcParams['legend.fontsize'] = 'x-small'
|
mpl.rcParams['legend.fontsize'] = 'x-small'
|
||||||
|
mpl.rcParams['figure.figsize'] = cm_size(figure_width, figure_height)
|
||||||
|
mpl.rcParams['figure.subplot.left'] = 0.11
|
||||||
|
mpl.rcParams['figure.subplot.right'] = 0.99
|
||||||
|
mpl.rcParams['figure.subplot.bottom'] = 0.23
|
||||||
|
mpl.rcParams['figure.subplot.top'] = 0.96
|
||||||
|
mpl.rcParams['figure.subplot.wspace'] = 0.4
|
||||||
|
mpl.rcParams['figure.subplot.hspace'] = 0.2
|
||||||
mpl.rcParams['figure.facecolor'] = 'white'
|
mpl.rcParams['figure.facecolor'] = 'white'
|
||||||
#mpl.rcParams['axes.spines.left'] = True # newer matplotlib only
|
#mpl.rcParams['axes.spines.left'] = True # newer matplotlib only
|
||||||
#mpl.rcParams['axes.spines.bottom'] = True
|
#mpl.rcParams['axes.spines.bottom'] = True
|
||||||
|
@ -9,7 +9,7 @@ for k = 1:3
|
|||||||
rand(1, n)
|
rand(1, n)
|
||||||
end
|
end
|
||||||
|
|
||||||
% serial corraltion at lag 1:
|
% serial correlation at lag 1:
|
||||||
n = 10000;
|
n = 10000;
|
||||||
x = rand(n, 1);
|
x = rand(n, 1);
|
||||||
r1 = corr(x(1:end-1), x(2:end));
|
r1 = corr(x(1:end-1), x(2:end));
|
||||||
|
@ -15,9 +15,8 @@ if __name__ == "__main__":
|
|||||||
indices = np.arange(n)
|
indices = np.arange(n)
|
||||||
data = sigma*rng.randn(len(indices))+mu
|
data = sigma*rng.randn(len(indices))+mu
|
||||||
|
|
||||||
fig = plt.figure(figsize=cm_size(16.0, 6.0))
|
fig = plt.figure()
|
||||||
spec = gridspec.GridSpec(nrows=1, ncols=2, width_ratios=[3, 1],
|
spec = gridspec.GridSpec(nrows=1, ncols=2, width_ratios=[3, 1], left=0.12, wspace=0.08)
|
||||||
left=0.12, bottom=0.23, right=0.97, top=0.96, wspace=0.08)
|
|
||||||
ax1 = fig.add_subplot(spec[0, 0])
|
ax1 = fig.add_subplot(spec[0, 0])
|
||||||
show_spines(ax1, 'lb')
|
show_spines(ax1, 'lb')
|
||||||
ax1.scatter(indices, data, c=colors['blue'], edgecolor='white', s=50)
|
ax1.scatter(indices, data, c=colors['blue'], edgecolor='white', s=50)
|
||||||
|
@ -20,9 +20,9 @@ if __name__ == "__main__":
|
|||||||
lags = np.arange(-maxl, maxl+1, 1)
|
lags = np.arange(-maxl, maxl+1, 1)
|
||||||
corrs = [np.corrcoef(x[maxl:-maxl-1-l], x[maxl+l:-maxl-1])[0, 1] for l in lags]
|
corrs = [np.corrcoef(x[maxl:-maxl-1-l], x[maxl+l:-maxl-1])[0, 1] for l in lags]
|
||||||
|
|
||||||
fig = plt.figure(figsize=cm_size(16.0, 11.0))
|
fig = plt.figure(figsize=cm_size(figure_width, 1.8*figure_height))
|
||||||
spec = gridspec.GridSpec(nrows=2, ncols=2,
|
spec = gridspec.GridSpec(nrows=2, ncols=2,
|
||||||
left=0.10, bottom=0.12, right=0.98, top=0.97,
|
left=0.11, bottom=0.12, right=0.98, top=0.97,
|
||||||
wspace=0.4, hspace=0.6)
|
wspace=0.4, hspace=0.6)
|
||||||
|
|
||||||
ax = fig.add_subplot(spec[0, 0])
|
ax = fig.add_subplot(spec[0, 0])
|
||||||
|
@ -20,9 +20,8 @@ if __name__ == "__main__":
|
|||||||
xx = np.linspace(xmin, xmax, 200)
|
xx = np.linspace(xmin, xmax, 200)
|
||||||
yy = boltzmann(xx, x0, k)
|
yy = boltzmann(xx, x0, k)
|
||||||
|
|
||||||
fig = plt.figure(figsize=cm_size(16.0, 6.0))
|
fig = plt.figure()
|
||||||
spec = gridspec.GridSpec(nrows=1, ncols=2,
|
spec = gridspec.GridSpec(nrows=1, ncols=2, left=0.1, wspace=0.4)
|
||||||
left=0.12, bottom=0.23, right=0.97, top=0.96, wspace=0.4)
|
|
||||||
ax1 = fig.add_subplot(spec[0, 0])
|
ax1 = fig.add_subplot(spec[0, 0])
|
||||||
show_spines(ax1, 'lb')
|
show_spines(ax1, 'lb')
|
||||||
ax1.plot(xx, yy, colors['red'], lw=2)
|
ax1.plot(xx, yy, colors['red'], lw=2)
|
||||||
|
Reference in New Issue
Block a user