Skip to content

Commit

Permalink
Merge pull request matplotlib#10806 from tacaswell/fix_escapes
Browse files Browse the repository at this point in the history
MNT: catch more illegal '\'
  • Loading branch information
phobson authored and dstansby committed May 29, 2018
1 parent 89fc4e4 commit 1fcd187
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/mpl_toolkits/axisartist/angle_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,18 @@ def __call__(self, v1, v2):


class FormatterDMS(object):
deg_mark = "^{\circ}"
min_mark = "^{\prime}"
sec_mark = "^{\prime\prime}"
deg_mark = r"^{\circ}"
min_mark = r"^{\prime}"
sec_mark = r"^{\prime\prime}"

fmt_d = "$%d" + deg_mark + "$"
fmt_ds = r"$%d.%s" + deg_mark + "$"

# %s for sign
fmt_d_m = r"$%s%d" + deg_mark + "\,%02d" + min_mark + "$"
fmt_d_ms = r"$%s%d" + deg_mark + "\,%02d.%s" + min_mark + "$"
fmt_d_m = r"$%s%d" + deg_mark + r"\,%02d" + min_mark + "$"
fmt_d_ms = r"$%s%d" + deg_mark + r"\,%02d.%s" + min_mark + "$"

fmt_d_m_partial = "$%s%d" + deg_mark + "\,%02d" + min_mark + "\,"
fmt_d_m_partial = "$%s%d" + deg_mark + r"\,%02d" + min_mark + r"\,"
fmt_s_partial = "%02d" + sec_mark + "$"
fmt_ss_partial = "%02d.%s" + sec_mark + "$"

Expand Down Expand Up @@ -315,18 +315,18 @@ def __call__(self, direction, factor, values):


class FormatterHMS(FormatterDMS):
deg_mark = "^\mathrm{h}"
min_mark = "^\mathrm{m}"
sec_mark = "^\mathrm{s}"
deg_mark = r"^\mathrm{h}"
min_mark = r"^\mathrm{m}"
sec_mark = r"^\mathrm{s}"

fmt_d = "$%d" + deg_mark + "$"
fmt_ds = r"$%d.%s" + deg_mark + "$"

# %s for sign
fmt_d_m = r"$%s%d" + deg_mark + "\,%02d" + min_mark+"$"
fmt_d_ms = r"$%s%d" + deg_mark + "\,%02d.%s" + min_mark+"$"
fmt_d_m = r"$%s%d" + deg_mark + r"\,%02d" + min_mark+"$"
fmt_d_ms = r"$%s%d" + deg_mark + r"\,%02d.%s" + min_mark+"$"

fmt_d_m_partial = "$%s%d" + deg_mark + "\,%02d" + min_mark + "\,"
fmt_d_m_partial = "$%s%d" + deg_mark + r"\,%02d" + min_mark + r"\,"
fmt_s_partial = "%02d" + sec_mark + "$"
fmt_ss_partial = "%02d.%s" + sec_mark + "$"

Expand Down

0 comments on commit 1fcd187

Please sign in to comment.