Skip to content

Commit

Permalink
Merge pull request #3637 from neutrinoceros/fix_ylabel_frac
Browse files Browse the repository at this point in the history
BUG: fix LaTeX typesetting for fractional ylabels in LinePlot
  • Loading branch information
matthewturk authored Nov 1, 2021
2 parents f741470 + 3d62648 commit 60c3524
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion yt/visualization/plot_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,10 @@ def _get_axes_unit_labels(self, unit_x, unit_y):
symbol_wo_prefix = un[1:]
if symbol_wo_prefix in self.ds.unit_registry.prefixable_units:
un = un.replace(pp, "{" + latex_prefixes[pp] + "}", 1)
axes_unit_labels[i] = r"\ \ (" + un + ")"
if r"\frac" in un:
axes_unit_labels[i] = r"\ \ \left(" + un + r"\right)"
else:
axes_unit_labels[i] = r"\ \ (" + un + r")"
return axes_unit_labels

def hide_colorbar(self, field=None):
Expand Down

0 comments on commit 60c3524

Please sign in to comment.