Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 380a603

Browse filesBrowse files
committed
Use raw strings to avoid invalid escape sequences.
1 parent 7f157b5 commit 380a603
Copy full SHA for 380a603

File tree

Expand file treeCollapse file tree

12 files changed

+15
-12
lines changed
Filter options
Expand file treeCollapse file tree

12 files changed

+15
-12
lines changed

‎examples/api/power_norm.py

Copy file name to clipboardExpand all lines: examples/api/power_norm.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
axes[0, 0].hist2d(data[:, 0], data[:, 1], bins=100)
2626

2727
for ax, gamma in zip(axes.flat[1:], gammas):
28-
ax.set_title('Power law $(\gamma=%1.1f)$' % gamma)
28+
ax.set_title(r'Power law $(\gamma=%1.1f)$' % gamma)
2929
ax.hist2d(data[:, 0], data[:, 1],
3030
bins=100, norm=mcolors.PowerNorm(gamma))
3131

‎examples/recipes/fill_between_alpha.py

Copy file name to clipboardExpand all lines: examples/recipes/fill_between_alpha.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
ax.plot(t, mu2, lw=2, label='mean population 2', color='yellow')
8282
ax.fill_between(t, mu1+sigma1, mu1-sigma1, facecolor='blue', alpha=0.5)
8383
ax.fill_between(t, mu2+sigma2, mu2-sigma2, facecolor='yellow', alpha=0.5)
84-
ax.set_title('random walkers empirical $\mu$ and $\pm \sigma$ interval')
84+
ax.set_title(r'random walkers empirical $\mu$ and $\pm \sigma$ interval')
8585
ax.legend(loc='upper left')
8686
ax.set_xlabel('num steps')
8787
ax.set_ylabel('position')

‎examples/recipes/placing_text_boxes.py

Copy file name to clipboardExpand all lines: examples/recipes/placing_text_boxes.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
mu = x.mean()
2121
median = np.median(x)
2222
sigma = x.std()
23-
textstr = '$\mu=%.2f$\n$\mathrm{median}=%.2f$\n$\sigma=%.2f$' % (mu, median, sigma)
23+
textstr = '\n'.join((
24+
r'$\mu=%.2f$' % (mu, ),
25+
r'$\mathrm{median}=%.2f$' % (median, ),
26+
r'$\sigma=%.2f$' % (sigma, )))
2427

2528
ax.hist(x, 50)
2629
# these are matplotlib.patch.Patch properties

‎examples/text_labels_and_annotations/arrow_demo.py

Copy file name to clipboardExpand all lines: examples/text_labels_and_annotations/arrow_demo.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def draw_arrow(pair, alpha=alpha, ec=ec, labelcolor=labelcolor):
213213
coords = np.dot(orig_position, M) + [[x_pos, y_pos]]
214214
x, y = np.ravel(coords)
215215
orig_label = rate_labels[pair]
216-
label = '$%s_{_{\mathrm{%s}}}$' % (orig_label[0], orig_label[1:])
216+
label = r'$%s_{_{\mathrm{%s}}}$' % (orig_label[0], orig_label[1:])
217217

218218
plt.text(x, y, label, size=label_text_size, ha='center', va='center',
219219
color=labelcolor or fc)

‎examples/ticks_and_spines/spines_bounds.py

Copy file name to clipboardExpand all lines: examples/ticks_and_spines/spines_bounds.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# set ticks and tick labels
2323
ax.set_xlim((0, 2*np.pi))
2424
ax.set_xticks([0, np.pi, 2*np.pi])
25-
ax.set_xticklabels(['0', '$\pi$', '2$\pi$'])
25+
ax.set_xticklabels(['0', r'$\pi$', r'2$\pi$'])
2626
ax.set_ylim((-1.5, 1.5))
2727
ax.set_yticks([-1, 0, 1])
2828

‎lib/matplotlib/sphinxext/plot_directive.py

Copy file name to clipboardExpand all lines: lib/matplotlib/sphinxext/plot_directive.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def remove_coding(text):
346346
r"""
347347
Remove the coding comment, which six.exec\_ doesn't like.
348348
"""
349-
sub_re = re.compile("^#\s*-\*-\s*coding:\s*.*-\*-$", flags=re.MULTILINE)
349+
sub_re = re.compile(r"^#\s*-\*-\s*coding:\s*.*-\*-$", flags=re.MULTILINE)
350350
return sub_re.sub("", text)
351351

352352
#------------------------------------------------------------------------------

‎tests.py

Copy file name to clipboardExpand all lines: tests.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
category=DeprecationWarning)
3434
warnings.filterwarnings(
3535
'default',
36-
'.*inspect.getargspec\(\) is deprecated.*',
36+
r'.*inspect.getargspec\(\) is deprecated.*',
3737
category=DeprecationWarning)
3838

3939
from matplotlib import test

‎tutorials/text/annotations.py

Copy file name to clipboardExpand all lines: tutorials/text/annotations.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
r"""
22
Annotations
33
===========
44

‎tutorials/text/pgf.py

Copy file name to clipboardExpand all lines: tutorials/text/pgf.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
r"""
22
*********************************
33
Typesetting With XeLaTeX/LuaLaTeX
44
*********************************

‎tutorials/text/usetex.py

Copy file name to clipboardExpand all lines: tutorials/text/usetex.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
r"""
22
*************************
33
Text rendering With LaTeX
44
*************************

‎tutorials/toolkits/axes_grid.py

Copy file name to clipboardExpand all lines: tutorials/toolkits/axes_grid.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
r"""
22
==============================
33
Overview of axes_grid1 toolkit
44
==============================

‎tutorials/toolkits/axisartist.py

Copy file name to clipboardExpand all lines: tutorials/toolkits/axisartist.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
r"""
22
==============================
33
Overview of axisartist toolkit
44
==============================

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.