Skip to content

Commit bd6a6ca

Browse files
committed
CHT: change xcorr to pcolormesh
1 parent 297ef35 commit bd6a6ca

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

cheatsheets.tex

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,15 @@
382382
\optional{extent},
383383
\optional{origin} }
384384
{}
385+
\plot{basic-pcolormesh.pdf}{\textbf{pcolormesh[f]}([X],[Y],Z,,…)}
386+
{https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.pcolormesh.html}
387+
{ \optional{X},
388+
\optional{Y},
389+
\mandatory{Z},
390+
\optional{vmin},
391+
\optional{vmax},
392+
\optional{cmap}}
393+
{}
385394
\plot{basic-quiver.pdf}{\textbf{quiver}([X],[Y],U,V,…)}
386395
{https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.quiver.html}
387396
{ \optional{X},
@@ -488,13 +497,6 @@
488497
\optional{gridsize},
489498
\optional{bins} }
490499
{}
491-
\plot{advanced-xcorr.pdf}{\textbf{xcorr}(X,Y,…)}
492-
{https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.xcorr.html}
493-
{\mandatory{X},
494-
\mandatory{Y},
495-
\optional{normed},
496-
\optional{detrend} }
497-
{}
498500
\end{myboxed}
499501

500502

figures/legend.pdf

-938 Bytes
Binary file not shown.

scripts/advanced-plots.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@
8383

8484
# Event plot
8585
# -----------------------------------------------------------------------------
86-
np.random.seed(1)
87-
X = [2,4,6]
88-
D = np.random.gamma(4, size=(3, 50))
89-
ax.eventplot(D, colors="C1", orientation="vertical", lineoffsets=X, linewidth=0.25)
90-
ax.set_xlim(0, 8), ax.set_xticks(np.arange(1,8))
91-
ax.set_ylim(0, 8), ax.set_yticks(np.arange(1,8))
92-
ax.set_axisbelow(True)
93-
ax.grid(linewidth=0.125)
94-
plt.savefig("../figures/advanced-event.pdf")
95-
ax.clear()
86+
if False:
87+
np.random.seed(1)
88+
X = [2,4,6]
89+
D = np.random.gamma(4, size=(3, 50))
90+
ax.eventplot(D, colors="C1", orientation="vertical", lineoffsets=X, linewidth=0.25)
91+
ax.set_xlim(0, 8), ax.set_xticks(np.arange(1,8))
92+
ax.set_ylim(0, 8), ax.set_yticks(np.arange(1,8))
93+
ax.set_axisbelow(True)
94+
ax.grid(linewidth=0.125)
95+
plt.savefig("../figures/advanced-event.pdf")
96+
ax.clear()
9697

9798
# Errorbar plot
9899
# -----------------------------------------------------------------------------

scripts/basic-plots.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,22 @@
7979
plt.savefig("../figures/basic-imshow.pdf")
8080
ax.clear()
8181

82-
83-
# Basic contour plot
82+
# Basic pcolormesh plot
8483
# -----------------------------------------------------------------------------
8584
np.random.seed(1)
8685
X, Y = np.meshgrid(np.linspace(-3, 3, 256), np.linspace(-3, 3, 256))
8786
Z = (1 - X/2. + X**5 + Y**3)*np.exp(-X**2-Y**2)
8887
Z = Z - Z.min()
88+
plt.pcolormesh(X, Y, Z, cmap='Oranges', shading='auto')
89+
ax.set_xlim(-3, 3), ax.set_xticks(np.arange(-3, 4))
90+
ax.set_ylim(-3, 3), ax.set_yticks(np.arange(-3,4))
91+
# ax.set_axisbelow(True)
92+
# ax.grid(linewidth=0.125, color="0.75")
93+
plt.savefig("../figures/basic-pcolormesh.pdf")
94+
ax.clear()
95+
96+
# Basic contour plot
97+
# -----------------------------------------------------------------------------
8998
colors = np.zeros((5,4))
9099
colors[:] = mpl.colors.to_rgba("C1")
91100
colors[:,3] = np.linspace(0.15, 0.85, len(colors))

0 commit comments

Comments
 (0)