Commit 260e542c authored by Simeon Doetsch's avatar Simeon Doetsch

Changed Formatter for colorbar

parent 50c35198
import os import os
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
class PlutoData: class PlutoData:
_coordinate_systems = {'cartesian': ['x', 'y', 'z'], _coordinate_systems = {'cartesian': ['x', 'y', 'z'],
...@@ -173,7 +174,9 @@ class PlutoData: ...@@ -173,7 +174,9 @@ class PlutoData:
ax.set_ylabel(self._latex(self.coord_names[1])) ax.set_ylabel(self._latex(self.coord_names[1]))
ax.set_aspect(1) ax.set_aspect(1)
if cbar: if cbar:
plt.colorbar(im, label=self._latex(varname)) formatter = ScalarFormatter()
plt.colorbar(im, label=self._latex(varname), format=formatter)
def __str__(self) -> None: def __str__(self) -> None:
return f"""PlutoData, wdir: '{self.wdir}' return f"""PlutoData, wdir: '{self.wdir}'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment