Skip to content

Commit

Permalink
BUG: fix LaTeX typesetting for fractional ylabels in ProfilePlot
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Nov 1, 2021
1 parent 7567464 commit 4284566
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion yt/visualization/plot_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,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 4284566

Please sign in to comment.