示例#1
0
    def __init__(
            self, x_data: Sequence, y_data: Sequence, size: int=40, color=None, key: str = None, **plot_settings: Any):
        """
        Creates a scatter plot based on the data specified.

        Parameters
        ----------
        x_data
            values of x coordinate
        y_data
            values of y coordinate
        size
            size in points^2; scalar or an array of the same length as x_data and y_data
        color
            *c* can be a single color format string, or a sequence of color specifications of length x_data and y_data,
            or a sequence of x_data and y_data numbers to be mapped to colors using the *cmap* and *norm* specified via
            kwargs (see below). Note that color should not be a single numeric RGB or RGBA sequence because that is
            indistinguishable from an array of values to be colormapped.  color can be a 2-D array in which the rows are
            RGB or RGBA, however, including the case of a single row to specify the same color for all points.
        plot_settings
            other settings like for example: alpha, linewidths, verts, edgecolors
        
        """
        ChartDecorator.__init__(self, key)
        SimpleLegendItem.__init__(self)
        self.x_data = x_data
        self.y_data = y_data
        self.size = size
        if color is None:
            self.color = Chart.get_axes_colors()[0]
        else:
            self.color = color
        self.plot_settings = plot_settings
    def __init__(self,
                 series_data_element: DataElementDecorator,
                 coordinates: Tuple[Any, Any],
                 color: str = None,
                 decimal_points: int = 2,
                 label_format: str = '  {:.4g}',
                 key: str = None,
                 use_secondary_axes: bool = False,
                 move_point: bool = True,
                 font_size: int = 15):
        # label_format = ' {:0.1E}'
        ChartDecorator.__init__(self, key)
        SimpleLegendItem.__init__(self)

        assert isinstance(series_data_element.data, pandas.Series)

        assert not pandas.isnull(coordinates[0])
        assert not pandas.isnull(coordinates[1])

        self._series_data_element = series_data_element
        self._series_point = coordinates
        self._color = color
        self._decimal_points = decimal_points
        self._label_format = label_format
        self._text_pos = None
        self._use_secondary_axes = use_secondary_axes
        self.move_point = move_point
        self.font_size = font_size
示例#3
0
 def __init__(self,
              series: QFSeries,
              key: str = None,
              use_secondary_axes: bool = False,
              **plot_settings: Any):
     ChartDecorator.__init__(self, key)
     SimpleLegendItem.__init__(self)
     self._series = series
     self.use_secondary_axes = use_secondary_axes
     self.plot_settings = plot_settings
 def __init__(self,
              window_size: int,
              series: QFSeries,
              key: str = None,
              **plot_settings: Any):
     ChartDecorator.__init__(self, key)
     SimpleLegendItem.__init__(self)
     self.window_size = window_size
     self.series = series
     self.plot_settings = plot_settings
示例#5
0
 def __init__(self,
              x: ScalarType,
              color: str = 'k',
              key: str = None,
              **plot_settings: Any):
     ChartDecorator.__init__(self, key)
     SimpleLegendItem.__init__(self)
     self._x = x
     self._color = color
     self.plot_settings = plot_settings
示例#6
0
 def __init__(self,
              series: QFSeries,
              key: str = None,
              marker_props: Mapping[str, Any] = None,
              stemline_props: Mapping[str, Any] = None,
              baseline_props: Mapping[str, Any] = None):
     ChartDecorator.__init__(self, key)
     SimpleLegendItem.__init__(self)
     self._series = series
     self.marker_props = marker_props
     self.stemline_props = stemline_props
     self.baseline_props = baseline_props
示例#7
0
 def __init__(self, data_container: object, key: str = None, use_secondary_axes: bool = False, **plot_settings: Any):
     """
     data_container
         container for the data to be charted (its type depends on the type of the chart)
     key
         Key is the identifier of the data element. It must be unique to each data element across the chart.
     use_secondary_axes
         Whether this data element should be plotted on the secondary axis.
     plot_settings:
         Additional settings for plotting the data element.
     """
     ChartDecorator.__init__(self, key)
     SimpleLegendItem.__init__(self)
     self.data = data_container
     self.use_secondary_axes = use_secondary_axes
     self.plot_settings = plot_settings
示例#8
0
    def __init__(self,
                 x: ScalarType,
                 color: str = 'k',
                 key: str = None,
                 **plot_settings: Any):
        """
        Constructs a new vertical line decorator. The ``plot_settings`` are passed directly to matplotlib's ``axvline``.
        See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.axvline for valid settings.

        When plotting for the web, the ``plot_settings`` are passed directly to HighChart's plotLines options.
        """
        ChartDecorator.__init__(self, key)
        SimpleLegendItem.__init__(self)
        self._x = x
        self._color = color
        self.plot_settings = plot_settings
    def __init__(self, series_data_element: DataElementDecorator, coordinates: Tuple[Any, Any], color: str = None,
                 decimal_points: int = 2, label_format: str = '  {:.4g}', key: str = None,
                 use_secondary_axes: bool = False, move_point: bool = True, font_size: int = 15):
        """
        Creates a new marker for `series_data_element` for `x=series_index`. For a timeseries, you can specify
        the time that you wish to be emphasised.

        Parameters
        ----------
        series_data_element
            The DataElementDecorator which should be decorated with an emphasised point.
        coordinates
            The x and y coordinate of the point that should be emphasised. The x and y coordinates should be expressed
            in data coordinates (e.g. the x coordinate should be a date if x-axis contains dates).
        color
            color of the marker; by default it will be the same as the decorated line
        decimal_points
            number of decimal points that should be shown in the point's label
        label_format
            A format string specifying how the label should be displayed. Takes two parameters: the index and value.
            useful values: ' {:0.1E}',  '  {:0.1f}'
        key
            see: ChartDecorator.__init__#key
        use_secondary_axes
            determines whether this PointEmphasis belongs on the secondary axis.
        """
        # label_format = ' {:0.1E}'
        ChartDecorator.__init__(self, key)
        SimpleLegendItem.__init__(self)

        assert isinstance(series_data_element.data, pandas.Series)

        assert not pandas.isnull(coordinates[0])
        assert not pandas.isnull(coordinates[1])

        self._series_data_element = series_data_element
        self._series_point = coordinates
        self._color = color
        self._decimal_points = decimal_points
        self._label_format = label_format
        self._text_pos = None
        self._use_secondary_axes = use_secondary_axes
        self.move_point = move_point
        self.font_size = font_size
示例#10
0
    def __init__(self,
                 window_size: int,
                 series: QFSeries,
                 key: str = None,
                 **plot_settings: Any):
        """
        Creates a new decorator which draws a moving average line.

        Parameters
        ----------
        window_size
            window size which will be used to draw moving average line
        series
            series to calculate the moving average line for
        plot_settings
            additional plot settings for matplotlib
        """
        ChartDecorator.__init__(self, key)
        SimpleLegendItem.__init__(self)
        self.window_size = window_size
        self.series = series
        self.plot_settings = plot_settings
示例#11
0
 def __init__(self, data_container: object, key: str = None, use_secondary_axes: bool = False, **plot_settings: Any):
     ChartDecorator.__init__(self, key)
     SimpleLegendItem.__init__(self)
     self.data = data_container
     self.use_secondary_axes = use_secondary_axes
     self.plot_settings = plot_settings
示例#12
0
 def __init__(self, key: str = None, **plot_settings: Any):
     ChartDecorator.__init__(self, key)
     SimpleLegendItem.__init__(self)
     self.plot_settings = plot_settings