From 033197a091feff8e6e4e13258b43eae7c0e3160a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 21 Mar 2017 06:48:21 -0500 Subject: [PATCH] Sort as they are written to plots.xml --- openmc/plots.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openmc/plots.py b/openmc/plots.py index 2ba5d9758..cc2fcc4b6 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -636,7 +636,8 @@ class Plot(object): subelement.text = ' '.join(str(x) for x in color) if self._colors: - for domain, color in self._colors.items(): + for domain, color in sorted(self._colors.items(), + key=lambda x: x[0].id): subelement = ET.SubElement(element, "color") subelement.set("id", str(domain.id)) if isinstance(color, string_types):