Skip to content

Commit aa80eee

Browse files
authored
Cht add pcolormesh (#91)
* CHT: change xcorr to pcolormesh * FIX * FIX * FIX
1 parent ae8c282 commit aa80eee

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- checkout
1212
- run:
1313
command: echo "placeholder"
14-
14+
1515
workflows:
1616
main:
1717
jobs:

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}([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/basic-plots.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,20 @@
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+
plt.savefig("../figures/basic-pcolormesh.pdf")
92+
ax.clear()
93+
94+
# Basic contour plot
95+
# -----------------------------------------------------------------------------
8996
colors = np.zeros((5,4))
9097
colors[:] = mpl.colors.to_rgba("C1")
9198
colors[:,3] = np.linspace(0.15, 0.85, len(colors))
@@ -94,8 +101,6 @@
94101
nchunk=10)
95102
ax.set_xlim(0, 8), ax.set_xticks(np.arange(1,8))
96103
ax.set_ylim(0, 8), ax.set_yticks(np.arange(1,8))
97-
# ax.set_axisbelow(True)
98-
# ax.grid(linewidth=0.125, color="0.75")
99104
plt.savefig("../figures/basic-contour.pdf")
100105
ax.clear()
101106

0 commit comments

Comments
 (0)