Skip to content

Commit c03e589

Browse files
committed
switched to matplotlib.pyplot.colormaps()
1 parent dfee2e4 commit c03e589

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

openmc_plotter/docks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from .scientific_spin_box import ScientificDoubleSpinBox
1717
from .plotmodel import (_SCORE_UNITS, _TALLY_VALUES,
1818
_REACTION_UNITS, _SPATIAL_FILTERS)
19+
import matplotlib.pyplot as plt
1920

2021

2122
class PlotterDock(QDockWidget):
@@ -785,7 +786,7 @@ def __init__(self, model, main_window, field, colormaps=None):
785786
self.colormapBox = QComboBox()
786787
if colormaps is None:
787788
colormaps = sorted(
788-
m for m in mcolormaps._gen_cmap_registry() if not m.endswith("_r"))
789+
m for m in plt.colormaps() if not m.endswith("_r"))
789790
for colormap in colormaps:
790791
self.colormapBox.addItem(colormap)
791792
cmap_connector = partial(main_window.editTallyDataColormap)

openmc_plotter/plotgui.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from .custom_widgets import HorizontalLine
2020

2121
from matplotlib.backends.backend_qt5agg import FigureCanvas
22+
import matplotlib.pyplot as plt
2223

2324

2425
class PlotImage(FigureCanvas):
@@ -927,7 +928,7 @@ def createPropertyTab(self, property_kind):
927928
propertyTab.maxBox.valueChanged.connect(connector3)
928929

929930
propertyTab.colormapBox = QComboBox(self)
930-
cmaps = sorted(m for m in mcolormaps._gen_cmap_registry()
931+
cmaps = sorted(m for m in plt.colormaps()
931932
if not m.endswith("_r"))
932933
for cmap in cmaps:
933934
propertyTab.colormapBox.addItem(cmap)

0 commit comments

Comments
 (0)