Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cheatsheets.tex
Original file line number Diff line number Diff line change
Expand Up @@ -968,12 +968,12 @@
\hspace*{2.5mm}~$\rightarrow$ fig.savefig("figure.pdf")\\
\textbf{… save a transparent figure?}\\
\hspace*{2.5mm}~$\rightarrow$ fig.savefig("figure.pdf", transparent=True)\\
\textbf{… clear a figure?}\\
\hspace*{2.5mm}~$\rightarrow$ ax.clear()\\
\textbf{… clear a figure/an axes?}\\
\hspace*{2.5mm}~$\rightarrow$ fig.clear() $\rightarrow$ ax.clear()\\
\textbf{… close all figures?}\\
\hspace*{2.5mm}~$\rightarrow$ plt.close("all")\\
\textbf{… remove ticks?}\\
\hspace*{2.5mm}~$\rightarrow$ ax.set\_xticks([])\\
\hspace*{2.5mm}~$\rightarrow$ ax.set\_[xy]ticks([])\\
\textbf{… remove tick labels ?}\\
\hspace*{2.5mm}~$\rightarrow$ ax.set\_[xy]ticklabels([])\\
\textbf{… rotate tick labels ?}\\
Expand Down
2 changes: 1 addition & 1 deletion scripts/anatomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def minor_tick(x, pos):
ax.set_xlabel("X axis label")
ax.set_ylabel("Y axis label")

ax.legend()
ax.legend(loc="upper right")


def circle(x, y, radius=0.15):
Expand Down
4 changes: 2 additions & 2 deletions scripts/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
plt.xlim(0, 6), plt.ylim(0, 1)
plt.xticks([]), plt.yticks([])

plt.annotate("Annotation", (5.5, .75), (0.1, .75), size=16, va="center",
plt.annotate("text", (5.5, .75), (0.75, .75), size=16, va="center", ha="center",
arrowprops=dict(facecolor='black', shrink=0.05))

plt.text( 5.5, 0.6, "xy\nycoords", size=10, va="top", ha="center", color=".5")
plt.text( 5.5, 0.6, "xy\nxycoords", size=10, va="top", ha="center", color=".5")
plt.text( .75, 0.6, "xytext\ntextcoords", size=10, va="top", ha="center", color=".5")

plt.savefig("../figures/annotate.pdf")
Expand Down