Skip to content

Commit

Permalink
Merge pull request #1767 from facero/plot_interactive-units
Browse files Browse the repository at this point in the history
Showing two decimals in energy
  • Loading branch information
adonath committed Sep 10, 2018
2 parents fdd303c + d73ade6 commit 359b4b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gammapy/maps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,18 +961,18 @@ def plot_interactive(self, rc_params=None, **kwargs):
for axis in self.geom.axes:
if axis.node_type == "edges":
options = [
"{:.0f} - {:.0f} {}".format(val_min, val_max, axis.unit)
"{:.2e} - {:.2e} {}".format(val_min, val_max, axis.unit)
for val_min, val_max in zip(axis.edges[:-1], axis.edges[1:])
]
else:
options = ["{:.0f} {}".format(val, axis.unit) for val in axis.center]
options = ["{:.2e} {}".format(val, axis.unit) for val in axis.center]

interact_kwargs[axis.name] = SelectionSlider(
options=options,
description="Select {}:".format(axis.name),
continuous_update=False,
style={"description_width": "initial"},
layout={"width": "36%"},
layout={"width": "50%"},
)
interact_kwargs[axis.name + "_options"] = fixed(options)

Expand Down

0 comments on commit 359b4b8

Please sign in to comment.