diff options
Diffstat (limited to 'silx/gui/plot/backends/BackendBase.py')
-rwxr-xr-x | silx/gui/plot/backends/BackendBase.py | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/silx/gui/plot/backends/BackendBase.py b/silx/gui/plot/backends/BackendBase.py index 75d999b..bcc93a5 100755 --- a/silx/gui/plot/backends/BackendBase.py +++ b/silx/gui/plot/backends/BackendBase.py @@ -1,7 +1,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2004-2019 European Synchrotron Radiation Facility +# Copyright (c) 2004-2020 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -63,8 +63,6 @@ class BackendBase(object): # Store a weakref to get access to the plot state. self._setPlot(plot) - self.__zoomBackAction = None - @property def _plot(self): """The plot this backend is attached to.""" @@ -83,24 +81,12 @@ class BackendBase(object): """ self._plotRef = weakref.ref(plot) - # Default Qt context menu - - def contextMenuEvent(self, event): - """Override QWidget.contextMenuEvent to implement the context menu""" - if self.__zoomBackAction is None: - from ..actions.control import ZoomBackAction # Avoid cyclic import - self.__zoomBackAction = ZoomBackAction(plot=self._plot, - parent=self._plot) - menu = qt.QMenu(self) - menu.addAction(self.__zoomBackAction) - menu.exec_(event.globalPos()) - # Add methods def addCurve(self, x, y, color, symbol, linewidth, linestyle, yaxis, - xerror, yerror, z, + xerror, yerror, fill, alpha, symbolsize, baseline): """Add a 1D curve given by x an y to the graph. @@ -134,7 +120,6 @@ class BackendBase(object): :type xerror: numpy.ndarray or None :param yerror: Values with the uncertainties on the y values :type yerror: numpy.ndarray or None - :param int z: Layer on which to draw the cuve :param bool fill: True to fill the curve, False otherwise :param float alpha: Curve opacity, as a float in [0., 1.] :param float symbolsize: Size of the symbol (if any) drawn @@ -144,7 +129,7 @@ class BackendBase(object): return object() def addImage(self, data, - origin, scale, z, + origin, scale, colormap, alpha): """Add an image to the plot. @@ -156,7 +141,6 @@ class BackendBase(object): :param scale: (scale X, scale Y) of the data. Default: (1., 1.) :type scale: 2-tuple of float - :param int z: Layer on which to draw the image :param ~silx.gui.colors.Colormap colormap: Colormap object to use. Ignored if data is RGB(A). :param float alpha: Opacity of the image, as a float in range [0, 1]. @@ -165,7 +149,7 @@ class BackendBase(object): return object() def addTriangles(self, x, y, triangles, - color, z, alpha): + color, alpha): """Add a set of triangles. :param numpy.ndarray x: The data corresponding to the x axis @@ -173,14 +157,13 @@ class BackendBase(object): :param numpy.ndarray triangles: The indices to make triangles as a (Ntriangle, 3) array :param numpy.ndarray color: color(s) as (npoints, 4) array - :param int z: Layer on which to draw the cuve :param float alpha: Opacity as a float in [0., 1.] :returns: The triangles' unique identifier used by the backend """ return object() - def addItem(self, x, y, shape, color, fill, overlay, z, - linestyle, linewidth, linebgcolor): + def addShape(self, x, y, shape, color, fill, overlay, + linestyle, linewidth, linebgcolor): """Add an item (i.e. a shape) to the plot. :param numpy.ndarray x: The X coords of the points of the shape @@ -190,7 +173,6 @@ class BackendBase(object): :param str color: Color of the item :param bool fill: True to fill the shape :param bool overlay: True if item is an overlay, False otherwise - :param int z: Layer on which to draw the item :param str linestyle: Style of the line. Only relevant for line markers where X or Y is None. Value in: @@ -545,7 +527,7 @@ class BackendBase(object): """ raise NotImplementedError() - def pixelToData(self, x, y, axis, check): + def pixelToData(self, x, y, axis): """Convert a position in pixels in the widget to a position in the data space. @@ -553,8 +535,6 @@ class BackendBase(object): :param float y: The Y coordinate in pixels. :param str axis: The Y axis to use for the conversion ('left' or 'right'). - :param bool check: True to check if the coordinates are in the - plot area. :returns: The corresponding position in data space or None if the pixel position is not in the plot area. :rtype: A tuple of 2 floats: (xData, yData) or None. |