[all data analysis] plots work for old and new matplotlib

This commit is contained in:
Jan Benda 2020-10-27 23:59:14 +01:00
parent d1c6174ae2
commit 2a4c7ff038
13 changed files with 145 additions and 270 deletions

View File

@ -38,7 +38,7 @@ ax.annotate('sampling\ndistribution',
connectionstyle="angle3,angleA=20,angleB=120") )
ax.annotate('bootstrap\ndistribution',
xy=(0.13, 3.3), xycoords='data',
xytext=(0.25, 4), textcoords='data',
xytext=(0.22, 4), textcoords='data',
arrowprops=dict(arrowstyle="->", relpos=(0.0,0.5),
connectionstyle="angle3,angleA=20,angleB=60") )
ax.bar(bins[:-1]-0.25*db, hmusrs, 0.5*db, **fsB)

View File

@ -44,19 +44,19 @@ ax.annotate('Measured\ncorrelation\nis significant!',
connectionstyle="angle3,angleA=10,angleB=80") )
ax.annotate('95% percentile',
xy=(0.14, 0.9), xycoords='data',
xytext=(0.2, 4.0), textcoords='data', ha='left',
xytext=(0.18, 4.0), textcoords='data', ha='left',
arrowprops=dict(arrowstyle="->", relpos=(0.1,0.0),
connectionstyle="angle3,angleA=30,angleB=70") )
connectionstyle="angle3,angleA=30,angleB=80") )
ax.annotate('Distribution of\nuncorrelated\nsamples',
xy=(-0.08, 3.6), xycoords='data',
xytext=(-0.22, 5.0), textcoords='data', ha='left',
arrowprops=dict(arrowstyle="->", relpos=(0.5,0.0),
connectionstyle="angle3,angleA=150,angleB=100") )
connectionstyle="angle3,angleA=150,angleB=110") )
ax.bar(b[:-1], h, width=b[1]-b[0], **fsC)
ax.bar(b[:-1][b[:-1]>=rq], h[b[:-1]>=rq], width=b[1]-b[0], **fsB)
ax.plot( [rd, rd], [0, 1], **lsA)
ax.set_xlim(-0.25, 0.35)
ax.set_xlabel('Correlation coefficient')
ax.set_ylabel('Probability density of H0')
ax.set_ylabel('Prob. density of H0')
plt.savefig('permutecorrelation.pdf')

View File

@ -26,7 +26,7 @@ ax.set_ylim(-0.02, 0.85)
ax.set_xticks(np.arange(0, 5))
ax.set_yticks(np.arange(0, 0.9, 0.2))
ax.set_xlabel('x')
ax.set_ylabel('Probability density')
ax.set_ylabel('Prob. density')
s = 1
for mu in mus :
r = 5.0*rng.rand()+2.0
@ -35,11 +35,11 @@ for mu in mus :
ax.annotate('', xy=(mu, 0.02), xycoords='data',
xytext=(mu, 0.75), textcoords='data',
arrowprops=dict(arrowstyle="->", relpos=(0.5,0.5),
connectionstyle=cs), zorder=1)
connectionstyle=cs), zorder=10)
if mu > rmu :
ax.text(mu-0.1, 0.04, '?', zorder=1, ha='right')
ax.text(mu-0.1, 0.04, '?', zorder=10, ha='right')
else :
ax.text(mu+0.1, 0.04, '?', zorder=1)
ax.text(mu+0.1, 0.04, '?', zorder=10)
for k, ls in enumerate([lsCm, lsBm, lsDm]) :
ax.plot(x, g[:,k], zorder=5, **ls)
ax.plot(xd, 0.05*rng.rand(len(xd))+0.2, zorder=10, **psAm)

View File

@ -29,7 +29,7 @@ ax1.set_ylim(0.0, 0.42)
ax1.set_xticks(np.arange(0, 11, 2))
ax1.set_yticks(np.arange(0, 0.42, 0.1))
ax1.set_xlabel('x')
ax1.set_ylabel('Probability density')
ax1.set_ylabel('Prob. density')
ax1.plot(xx, yy, label='pdf', **lsB)
ax1.plot(xx, yf, label='mle', **lsCm)
kernel = st.gaussian_kde(xd)
@ -54,7 +54,7 @@ ax2.set_xticks(np.arange(0, 11, 2))
ax2.set_xlabel('x')
ax2.set_ylim(0.0, 0.42)
ax2.set_yticks(np.arange(0, 0.42, 0.1))
ax2.set_ylabel('Probability density')
ax2.set_ylabel('Prob. density')
ax2.plot(xx, yy, label='pdf', **lsB)
ax2.plot(xx, yc, label='fit', **lsCm)
ax2.bar(b[:-1], h, np.diff(b), **fsA)

View File

@ -6,7 +6,7 @@ from plotstyle import *
fig = plt.figure()
spec = gridspec.GridSpec(nrows=1, ncols=2, wspace=0.3,
**adjust_fs(fig, left=5.5))
**adjust_fs(fig, left=5.5, top=1))
spec1 = gridspec.GridSpecFromSubplotSpec(1, 2, spec[0, 0], width_ratios=[3, 1], wspace=0.0)
spec2 = gridspec.GridSpecFromSubplotSpec(1, 2, spec[0, 1], width_ratios=[3, 1], wspace=0.0)
@ -34,7 +34,7 @@ ax.set_ylabel('y')
ax.plot(x, y, label='data', zorder=10, **psAm)
ax.plot(xx, yy, label='original', zorder=5, **lsB)
ax.plot(xx, yf, label='fit', zorder=7, **lsCm)
ax.legend(loc='upper left', bbox_to_anchor=(0.0, 1.15))
ax.legend(loc='upper left', bbox_to_anchor=(-0.05, 1.2))
ax = fig.add_subplot(spec1[0, 1])
ax.show_spines('l')

View File

@ -277,7 +277,7 @@ def axis_label(label, unit=None):
if not unit:
return label
elif xkcd_style:
return '%s / %s' % (label, unit)
return '%s/%s' % (label, unit)
else:
return '%s [%s]' % (label, unit)

View File

@ -149,7 +149,7 @@ def plot_comparison(spike_times, bin_width, sigma, max_t=30., dt=1e-4):
ax1.show_spines('b')
ax1.vlines(times[times < (100000*dt)], ymin=0, ymax=1, color=colors['blue'], lw=1.5)
#ax1.set_ylabel('Spikes')
ax1.text(-0.105, 0.5, 'Spikes', transform=ax1.transAxes,
ax1.text(-0.13, 0.5, 'Spikes', transform=ax1.transAxes,
rotation='vertical', va='center')
ax1.set_xlim(2.5, 3.5)
ax1.set_ylim(-0.2, 1)
@ -159,7 +159,7 @@ def plot_comparison(spike_times, bin_width, sigma, max_t=30., dt=1e-4):
ax2.plot(time, inst_rate, color=colors['orange'], lw=2)
ax2.text(1.0, 1.0, 'instantaneous rate', transform=ax2.transAxes, ha='right')
#ax2.set_ylabel('Rate', 'Hz')
ax2.text(-0.105, 0.5, axis_label('Rate', 'Hz'), transform=ax2.transAxes,
ax2.text(-0.13, 0.5, axis_label('Rate', 'Hz'), transform=ax2.transAxes,
rotation='vertical', va='center')
ax2.set_xlim(2.5, 3.5)
ax2.set_ylim(0, 300)
@ -170,7 +170,7 @@ def plot_comparison(spike_times, bin_width, sigma, max_t=30., dt=1e-4):
ax3.plot(time, binn_rate, color=colors['orange'], lw=2)
ax3.text(1.0, 1.0, 'binned rate', transform=ax3.transAxes, ha='right')
#ax3.set_ylabel('Rate', 'Hz')
ax3.text(-0.105, 0.5, axis_label('Rate', 'Hz'), transform=ax3.transAxes,
ax3.text(-0.13, 0.5, axis_label('Rate', 'Hz'), transform=ax3.transAxes,
rotation='vertical', va='center')
ax3.set_xlim(2.5, 3.5)
ax3.set_ylim(0, 300)
@ -182,7 +182,7 @@ def plot_comparison(spike_times, bin_width, sigma, max_t=30., dt=1e-4):
ax4.text(1.0, 1.0, 'convolved rate', transform=ax4.transAxes, ha='right')
ax4.set_xlabel('Time', 's')
#ax4.set_ylabel('Rate', 'Hz')
ax4.text(-0.105, 0.5, axis_label('Rate', 'Hz'), transform=ax4.transAxes,
ax4.text(-0.13, 0.5, axis_label('Rate', 'Hz'), transform=ax4.transAxes,
rotation='vertical', va='center')
ax4.set_xlim(2.5, 3.5)
ax4.set_xticks([2.5, 2.75, 3.0, 3.25, 3.5])

View File

@ -31,7 +31,7 @@ def setup_axis(spikes_ax, rate_ax):
spikes_ax.show_spines('')
spikes_ax.set_yticks([])
spikes_ax.set_ylim(-0.2, 1.0)
spikes_ax.text(-0.1, 0.5, 'Spikes', transform=spikes_ax.transAxes, rotation='vertical', va='center')
spikes_ax.text(-0.11, 0.5, 'Spikes', transform=spikes_ax.transAxes, rotation='vertical', va='center')
spikes_ax.set_xlim(-1, 500)
spikes_ax.set_xticklabels([])
#spikes_ax.set_xticklabels(np.arange(0., 600, 100))
@ -39,7 +39,7 @@ def setup_axis(spikes_ax, rate_ax):
spikes_ax.show_spines('lb')
rate_ax.set_xlabel('Time', 'ms')
#rate_ax.set_ylabel('Firing rate', 'Hz')
rate_ax.text(-0.1, 0.5, axis_label('Rate', 'Hz'), transform=rate_ax.transAxes,
rate_ax.text(-0.11, 0.5, axis_label('Rate', 'Hz'), transform=rate_ax.transAxes,
rotation='vertical', va='center')
rate_ax.set_xlim(0, 500)
#rate_ax.set_xticklabels(np.arange(0., 600, 100))
@ -126,7 +126,7 @@ def plot_isi_method():
t_start = 1000*spike_times[i-1]
t = 1000*spike_times[i]
spikes_ax.plot([t_start, t_start], [0., 1.], color=colors['blue'], lw=2)
spikes_ax.annotate(s='', xy=(t_start, 0.5), xytext=(t,0.5), arrowprops=dict(arrowstyle='<->'), color=colors['red'])
spikes_ax.annotate('', xy=(t_start, 0.5), xytext=(t,0.5), arrowprops=dict(arrowstyle='<->'), color=colors['red'])
spikes_ax.text(0.5*(t_start+t), 1.05,
"{0:.0f}".format((t - t_start)),
color=colors['red'], ha='center')

View File

@ -1,7 +1,7 @@
%!PS-Adobe-2.0 EPSF-2.0
%%Title: pointprocessscetchA.tex
%%Creator: gnuplot 5.0 patchlevel 5
%%CreationDate: Tue Jan 7 10:05:37 2020
%%Creator: gnuplot 4.6 patchlevel 4
%%CreationDate: Tue Oct 27 23:58:04 2020
%%DocumentFonts:
%%BoundingBox: 50 50 373 135
%%EndComments
@ -18,7 +18,6 @@ gnudict begin
/Dashlength 1 def
/Landscape false def
/Level1 false def
/Level3 false def
/Rounded true def
/ClipToBoundingBox false def
/SuppressPDFMark false def
@ -30,11 +29,11 @@ gnudict begin
%
/vshift -73 def
/dl1 {
10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
10.0 Dashlength mul mul
Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if
} def
/dl2 {
10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
10.0 Dashlength mul mul
Rounded { currentlinewidth 0.75 mul add } if
} def
/hpt_ 31.5 def
@ -48,7 +47,7 @@ gnudict begin
} if
} def
%
% Gnuplot Prolog Version 5.1 (Oct 2015)
% Gnuplot Prolog Version 4.6 (September 2012)
%
%/SuppressPDFMark true def
%
@ -65,11 +64,11 @@ gnudict begin
/vpt2 vpt 2 mul def
/hpt2 hpt 2 mul def
/Lshow {currentpoint stroke M 0 vshift R
Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
/Rshow {currentpoint stroke M dup stringwidth pop neg vshift R
Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
/Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R
Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
/UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
/hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def
/DL {Color {setrgbcolor Solid {pop []} if 0 setdash}
@ -83,7 +82,7 @@ gnudict begin
/PL {stroke userlinewidth setlinewidth
Rounded {1 setlinejoin 1 setlinecap} if} def
3.8 setmiterlimit
% Classic Line colors (version 5.0)
% Default Line colors
/LCw {1 1 1} def
/LCb {0 0 0} def
/LCa {0 0 0} def
@ -96,21 +95,19 @@ gnudict begin
/LC6 {0 0 0} def
/LC7 {1 0.3 0} def
/LC8 {0.5 0.5 0.5} def
% Default dash patterns (version 5.0)
/LTB {BL [] LCb DL} def
% Default Line Types
/LTw {PL [] 1 setgray} def
/LTb {PL [] LCb DL} def
/LTb {BL [] LCb DL} def
/LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def
/LT0 {PL [] LC0 DL} def
/LT1 {PL [2 dl1 3 dl2] LC1 DL} def
/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def
/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def
/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
/LT5 {PL [4 dl1 2 dl2] LC5 DL} def
/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def
/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def
/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def
/SL {[] 0 setdash} def
/LT1 {PL [4 dl1 2 dl2] LC1 DL} def
/LT2 {PL [2 dl1 3 dl2] LC2 DL} def
/LT3 {PL [1 dl1 1.5 dl2] LC3 DL} def
/LT4 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
/LT5 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC5 DL} def
/LT6 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC6 DL} def
/LT7 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC7 DL} def
/LT8 {PL [2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 4 dl2] LC8 DL} def
/Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def
/Dia {stroke [] 0 setdash 2 copy vpt add M
hpt neg vpt neg V hpt vpt neg V
@ -332,14 +329,9 @@ gnudict begin
%
/languagelevel where
{pop languagelevel} {1} ifelse
dup 2 lt
{/InterpretLevel1 true def
/InterpretLevel3 false def}
{/InterpretLevel1 Level1 def
2 gt
{/InterpretLevel3 Level3 def}
{/InterpretLevel3 false def}
ifelse }
2 lt
{/InterpretLevel1 true def}
{/InterpretLevel1 Level1 def}
ifelse
%
% PostScript level 2 pattern fill definitions
@ -428,7 +420,6 @@ Level1 {Level1PatternFill} {Level2PatternFill} ifelse
/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont
dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall
currentdict end definefont pop
%
Level1 SuppressPDFMark or
{} {
/SDict 10 dict def
@ -438,42 +429,14 @@ systemdict /pdfmark known not {
SDict begin [
/Title (pointprocessscetchA.tex)
/Subject (gnuplot plot)
/Creator (gnuplot 5.0 patchlevel 5)
/Author (benda)
/Creator (gnuplot 4.6 patchlevel 4)
/Author (jan)
% /Producer (gnuplot)
% /Keywords ()
/CreationDate (Tue Jan 7 10:05:37 2020)
/CreationDate (Tue Oct 27 23:58:04 2020)
/DOCINFO pdfmark
end
} ifelse
%
% Support for boxed text - Ethan A Merritt May 2005
%
/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put
userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put
/Boxing true def } def
/ExtendTextBox { Boxing
{ gsave dup false charpath pathbbox
dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse
dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse
dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse
dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse
grestore } if } def
/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M
TBx1 TBxmargin sub TBy2 TBymargin add L
TBx2 TBxmargin add TBy2 TBymargin add L
TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def
/DrawTextBox { PopTextBox stroke /Boxing false def} def
/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def
0 0 0 0 InitTextBox
/TBxmargin 20 def
/TBymargin 20 def
/Boxing false def
/textshow { ExtendTextBox Gshow } def
%
% redundant definitions for compatibility with prologue.ps older than 5.0.2
/LTB {BL [] LCb DL} def
/LTb {PL [] LCb DL} def
end
%%EndProlog
%%Page: 1 1
@ -487,9 +450,10 @@ newpath
2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 1.000 UP
LTb
LCb setrgbcolor
LTb
1.000 UL
LTb
gsave 6208 824 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill
@ -503,11 +467,9 @@ gsave 6208 824 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill
stroke
2.000 UL
LTb
0.00 0.00 0.00 C % Begin plot #1
10.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 10.000 UL
LT0
LC0 setrgbcolor
0.00 0.00 0.00 C 910 573 M
0 503 V
1412 573 M
@ -526,16 +488,11 @@ LCb setrgbcolor
0 503 V
5685 573 M
0 503 V
1.000 UP
stroke
LTw
% End plot #1
2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
1.000 UP
2.000 UL
LTb
0.00 0.00 0.00 C stroke
grestore
end

View File

@ -1,7 +1,7 @@
%!PS-Adobe-2.0 EPSF-2.0
%%Title: pointprocessscetchB.tex
%%Creator: gnuplot 5.0 patchlevel 5
%%CreationDate: Tue Jan 7 10:05:38 2020
%%Creator: gnuplot 4.6 patchlevel 4
%%CreationDate: Tue Oct 27 23:58:04 2020
%%DocumentFonts:
%%BoundingBox: 50 50 373 237
%%EndComments
@ -18,7 +18,6 @@ gnudict begin
/Dashlength 1 def
/Landscape false def
/Level1 false def
/Level3 false def
/Rounded true def
/ClipToBoundingBox false def
/SuppressPDFMark false def
@ -30,11 +29,11 @@ gnudict begin
%
/vshift -73 def
/dl1 {
10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
10.0 Dashlength mul mul
Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if
} def
/dl2 {
10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
10.0 Dashlength mul mul
Rounded { currentlinewidth 0.75 mul add } if
} def
/hpt_ 31.5 def
@ -48,7 +47,7 @@ gnudict begin
} if
} def
%
% Gnuplot Prolog Version 5.1 (Oct 2015)
% Gnuplot Prolog Version 4.6 (September 2012)
%
%/SuppressPDFMark true def
%
@ -65,11 +64,11 @@ gnudict begin
/vpt2 vpt 2 mul def
/hpt2 hpt 2 mul def
/Lshow {currentpoint stroke M 0 vshift R
Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
/Rshow {currentpoint stroke M dup stringwidth pop neg vshift R
Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
/Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R
Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
/UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
/hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def
/DL {Color {setrgbcolor Solid {pop []} if 0 setdash}
@ -83,7 +82,7 @@ gnudict begin
/PL {stroke userlinewidth setlinewidth
Rounded {1 setlinejoin 1 setlinecap} if} def
3.8 setmiterlimit
% Classic Line colors (version 5.0)
% Default Line colors
/LCw {1 1 1} def
/LCb {0 0 0} def
/LCa {0 0 0} def
@ -96,21 +95,19 @@ gnudict begin
/LC6 {0 0 0} def
/LC7 {1 0.3 0} def
/LC8 {0.5 0.5 0.5} def
% Default dash patterns (version 5.0)
/LTB {BL [] LCb DL} def
% Default Line Types
/LTw {PL [] 1 setgray} def
/LTb {PL [] LCb DL} def
/LTb {BL [] LCb DL} def
/LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def
/LT0 {PL [] LC0 DL} def
/LT1 {PL [2 dl1 3 dl2] LC1 DL} def
/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def
/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def
/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
/LT5 {PL [4 dl1 2 dl2] LC5 DL} def
/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def
/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def
/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def
/SL {[] 0 setdash} def
/LT1 {PL [4 dl1 2 dl2] LC1 DL} def
/LT2 {PL [2 dl1 3 dl2] LC2 DL} def
/LT3 {PL [1 dl1 1.5 dl2] LC3 DL} def
/LT4 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
/LT5 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC5 DL} def
/LT6 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC6 DL} def
/LT7 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC7 DL} def
/LT8 {PL [2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 4 dl2] LC8 DL} def
/Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def
/Dia {stroke [] 0 setdash 2 copy vpt add M
hpt neg vpt neg V hpt vpt neg V
@ -332,14 +329,9 @@ gnudict begin
%
/languagelevel where
{pop languagelevel} {1} ifelse
dup 2 lt
{/InterpretLevel1 true def
/InterpretLevel3 false def}
{/InterpretLevel1 Level1 def
2 gt
{/InterpretLevel3 Level3 def}
{/InterpretLevel3 false def}
ifelse }
2 lt
{/InterpretLevel1 true def}
{/InterpretLevel1 Level1 def}
ifelse
%
% PostScript level 2 pattern fill definitions
@ -428,7 +420,6 @@ Level1 {Level1PatternFill} {Level2PatternFill} ifelse
/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont
dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall
currentdict end definefont pop
%
Level1 SuppressPDFMark or
{} {
/SDict 10 dict def
@ -438,42 +429,14 @@ systemdict /pdfmark known not {
SDict begin [
/Title (pointprocessscetchB.tex)
/Subject (gnuplot plot)
/Creator (gnuplot 5.0 patchlevel 5)
/Author (benda)
/Creator (gnuplot 4.6 patchlevel 4)
/Author (jan)
% /Producer (gnuplot)
% /Keywords ()
/CreationDate (Tue Jan 7 10:05:38 2020)
/CreationDate (Tue Oct 27 23:58:04 2020)
/DOCINFO pdfmark
end
} ifelse
%
% Support for boxed text - Ethan A Merritt May 2005
%
/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put
userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put
/Boxing true def } def
/ExtendTextBox { Boxing
{ gsave dup false charpath pathbbox
dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse
dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse
dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse
dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse
grestore } if } def
/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M
TBx1 TBxmargin sub TBy2 TBymargin add L
TBx2 TBxmargin add TBy2 TBymargin add L
TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def
/DrawTextBox { PopTextBox stroke /Boxing false def} def
/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def
0 0 0 0 InitTextBox
/TBxmargin 20 def
/TBymargin 20 def
/Boxing false def
/textshow { ExtendTextBox Gshow } def
%
% redundant definitions for compatibility with prologue.ps older than 5.0.2
/LTB {BL [] LCb DL} def
/LTb {PL [] LCb DL} def
end
%%EndProlog
%%Page: 1 1
@ -487,9 +450,10 @@ newpath
2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 1.000 UP
LTb
LCb setrgbcolor
LTb
1.000 UL
LTb
gsave 6208 3165 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill
@ -503,11 +467,9 @@ gsave 6208 3165 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill
stroke
2.000 UL
LTb
0.00 0.00 0.00 C % Begin plot #1
10.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 10.000 UL
LT0
LC0 setrgbcolor
0.00 0.00 0.00 C 910 3029 M
0 272 V
502 -272 R
@ -526,22 +488,18 @@ LCb setrgbcolor
0 272 V
5685 3029 M
0 272 V
1.000 UP
stroke
LTw
% End plot #1
2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
1.000 UP
2.000 UL
LTb
0.00 0.00 0.00 C 2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 1.000 UP
LTb
LCb setrgbcolor
LTb
1.000 UL
LTb
gsave 6208 2043 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill
@ -552,86 +510,76 @@ gsave 6208 2043 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill
0 -32 V
-5680 0 R
5680 0 V
stroke
1291 1929 M
121 32 V
-121 32 V
-260 0 R
910 1961 L
121 -32 V
-121 32 R
-260 -64 R
-121 32 V
121 32 V
910 1961 M
502 0 V
stroke
2002 1929 M
590 -32 R
121 32 V
-121 32 V
-469 0 R
-121 -32 V
121 -32 V
-121 32 R
-469 -64 R
-121 32 V
121 32 V
-121 -32 R
711 0 V
stroke
2329 1939 M
206 -22 R
84 22 V
-84 22 V
-122 0 R
-84 -22 V
84 -22 V
-84 22 R
-122 -44 R
-84 22 V
84 22 V
-84 -22 R
290 0 V
stroke
2629 1938 M
216 -23 R
88 23 V
-88 23 V
-128 0 R
-88 -23 V
88 -23 V
-88 23 R
-128 -46 R
-88 23 V
88 23 V
-88 -23 R
304 0 V
stroke
3046 1929 M
329 -32 R
121 32 V
-121 32 V
-208 0 R
-121 -32 V
121 -32 V
-121 32 R
-208 -64 R
-121 32 V
121 32 V
-121 -32 R
450 0 V
stroke
3912 1929 M
745 -32 R
121 32 V
-121 32 V
-624 0 R
-121 -32 V
121 -32 V
-121 32 R
-624 -64 R
-121 32 V
121 32 V
-121 -32 R
866 0 V
stroke
4529 1929 M
496 -32 R
121 32 V
-121 32 V
-375 0 R
-121 -32 V
121 -32 V
-121 32 R
-375 -64 R
-121 32 V
121 32 V
-121 -32 R
617 0 V
stroke
5564 1929 M
914 -32 R
121 32 V
-121 32 V
-793 0 R
-121 -32 V
121 -32 V
-121 32 R
-793 -64 R
-121 32 V
121 32 V
-121 -32 R
1035 0 V
stroke
2.000 UL
LTb
0.00 0.00 0.00 C % Begin plot #1
10.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 10.000 UL
LT0
LC0 setrgbcolor
0.00 0.00 0.00 C 910 1907 M
0 272 V
502 -272 R
@ -650,60 +598,47 @@ LCb setrgbcolor
0 272 V
5685 1907 M
0 272 V
1.000 UP
stroke
LTw
% End plot #1
2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
1.000 UP
2.000 UL
LTb
0.00 0.00 0.00 C 2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 528 268 M
-63 0 V
stroke
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 528 460 M
-63 0 V
stroke
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 528 652 M
-63 0 V
stroke
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 528 844 M
-63 0 V
stroke
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 528 1036 M
-63 0 V
stroke
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 528 1228 M
-63 0 V
stroke
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 528 1276 M
528 220 L
5801 0 R
@ -711,7 +646,9 @@ LCb setrgbcolor
-5801 0 R
1.000 UP
stroke
LTb
LCb setrgbcolor
LTb
1.000 UL
LTb
gsave 6208 268 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill
@ -725,11 +662,9 @@ gsave 6208 268 N 0 -32 V 121 32 V -121 32 V 0 -32 V 1 PolyFill
stroke
2.000 UL
LTb
0.00 0.00 0.00 C % Begin plot #1
3.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
0.00 0.00 0.00 C 3.000 UL
LT0
LC0 setrgbcolor
0.00 0.00 0.00 C 528 268 M
382 0 V
0 96 R
@ -750,15 +685,11 @@ LCb setrgbcolor
1035 0 V
0 96 R
533 0 V
stroke
LTw
% End plot #1
% Begin plot #2
1.500 UP
stroke
2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
LT0
LC0 setrgbcolor
0.00 0.00 0.00 C 910 268 CircleF
1412 364 CircleF
2123 460 CircleF
@ -768,14 +699,10 @@ LCb setrgbcolor
4033 844 CircleF
4650 940 CircleF
5685 1036 CircleF
LTw
% End plot #2
% Begin plot #3
1.000 UP
2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
LT0
LC0 setrgbcolor
1.00 1.00 1.00 C 910 268 CircleF
1412 364 CircleF
2123 460 CircleF
@ -785,14 +712,10 @@ LCb setrgbcolor
4033 844 CircleF
4650 940 CircleF
5685 1036 CircleF
LTw
% End plot #3
% Begin plot #4
1.500 UP
2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
LT0
LC0 setrgbcolor
0.00 0.00 0.00 C 910 364 CircleF
1412 460 CircleF
2123 556 CircleF
@ -802,15 +725,10 @@ LCb setrgbcolor
4033 940 CircleF
4650 1036 CircleF
5685 1132 CircleF
LTw
% End plot #4
2.000 UL
LTb
LCb setrgbcolor
[] 0 setdash
1.000 UP
2.000 UL
LTb
LCb setrgbcolor
0.00 0.00 0.00 C stroke
grestore
end

View File

@ -24,7 +24,7 @@ ax.set_xlabel('x')
ax.set_ylabel('y', rotation='horizontal')
ax.set_xticks(np.arange(x1, x2+0.1, 1.0))
ax.set_yticks(np.arange(x1, x2+0.1, 1.0))
ax.contour(X, Y, Z, linewidths=2, zorder=0)
ax.contour(X, Y, Z, linewidths=2, cmap='jet', zorder=0)
# gradients:
xxg = [-1.1, 1.4, -1.0]
@ -35,8 +35,8 @@ for xg, yg in zip(xxg, yyg) :
ax.scatter(xg, yg, c='k', s=100, zorder=10)
ax.quiver([xg, xg], [yg, yg], [g[0], 0.0], [0.0, g[1]], units='xy', angles='uv', scale_units='x', scale=0.5, zorder=10)
ax.quiver([xg], [yg], [g[0]], [g[1]], units='xy', angles='uv', scale_units='x', scale=0.5, zorder=10, lw=2)
ax.text(-0.8, -1.5, '$\partial f/\partial x$', ha='center', zorder=20)
ax.text(-1.55, -0.8, '$\partial f/\partial y$', va='center', rotation='vertical', zorder=20)
ax.text(-0.4, -0.8, r'$\nabla f$', ha='left', zorder=20)
ax.text(-0.8, -1.4, '$\partial f/\partial x$', ha='center', zorder=20)
ax.text(-1.45, -0.8, '$\partial f/\partial y$', va='center', rotation='vertical', zorder=20)
ax.text(-0.5, -0.8, r'$\nabla f$', ha='left', zorder=20)
plt.savefig('gradient.pdf')