Skip to content
Snippets Groups Projects
Commit 46277822 authored by Phil Colebrooke's avatar Phil Colebrooke
Browse files

Re #28464 make dialogs show when z-axis is double clicked

parent 3b7f9634
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,7 @@ from mantidqt.widgets.plotconfigdialog.curvestabwidget import curve_has_errors, ...@@ -31,7 +31,7 @@ from mantidqt.widgets.plotconfigdialog.curvestabwidget import curve_has_errors,
from workbench.plotting.figureerrorsmanager import FigureErrorsManager from workbench.plotting.figureerrorsmanager import FigureErrorsManager
from workbench.plotting.propertiesdialog import (LabelEditor, XAxisEditor, YAxisEditor, from workbench.plotting.propertiesdialog import (LabelEditor, XAxisEditor, YAxisEditor,
SingleMarkerEditor, GlobalMarkerEditor, SingleMarkerEditor, GlobalMarkerEditor,
ColorbarAxisEditor) ColorbarAxisEditor, ZAxisEditor)
from workbench.plotting.style import VALID_LINE_STYLE, VALID_COLORS from workbench.plotting.style import VALID_LINE_STYLE, VALID_COLORS
from workbench.plotting.toolbar import ToolbarStateManager from workbench.plotting.toolbar import ToolbarStateManager
...@@ -227,6 +227,12 @@ class FigureInteraction(object): ...@@ -227,6 +227,12 @@ class FigureInteraction(object):
move_and_show(YAxisEditor(canvas, ax)) move_and_show(YAxisEditor(canvas, ax))
else: else:
move_and_show(ColorbarAxisEditor(canvas, ax)) move_and_show(ColorbarAxisEditor(canvas, ax))
if hasattr(ax, 'zaxis'):
if ax.zaxis.label.contains(event)[0]:
move_and_show(LabelEditor(canvas, ax.zaxis.label))
elif (ax.zaxis.contains(event)[0]
or any(tick.contains(event)[0] for tick in ax.get_zticklabels())):
move_and_show(ZAxisEditor(canvas, ax))
def _show_markers_menu(self, markers, event): def _show_markers_menu(self, markers, event):
""" """
...@@ -765,5 +771,6 @@ class FigureInteraction(object): ...@@ -765,5 +771,6 @@ class FigureInteraction(object):
for ax in self.canvas.figure.get_axes(): for ax in self.canvas.figure.get_axes():
images = ax.get_images() + [col for col in ax.collections if isinstance(col, Collection)] images = ax.get_images() + [col for col in ax.collections if isinstance(col, Collection)]
for image in images: for image in images:
datafunctions.update_colorbar_scale(self.canvas.figure, image, scale_type, image.norm.vmin, image.norm.vmax) datafunctions.update_colorbar_scale(self.canvas.figure, image, scale_type, image.norm.vmin,
image.norm.vmax)
self.canvas.draw_idle() self.canvas.draw_idle()
...@@ -189,6 +189,13 @@ class YAxisEditor(AxisEditor): ...@@ -189,6 +189,13 @@ class YAxisEditor(AxisEditor):
self.create_model() self.create_model()
class ZAxisEditor(AxisEditor):
def __init__(self, canvas, axes):
super(ZAxisEditor, self).__init__(canvas, axes, 'z')
self.create_model()
class ColorbarAxisEditor(AxisEditor): class ColorbarAxisEditor(AxisEditor):
def __init__(self, canvas, axes): def __init__(self, canvas, axes):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment