Ejemplo n.º 1
0
    def __init__(self, fig=None, *args, **kwargs):

        # Retrieve the series ...................
        _series = kwargs.pop("series", getattr(fig, "series", None))
        Subplot.__init__(self, fig, *args, **kwargs)

        # Process options .......................
        if _series is not None:
            assert hasattr(_series, "dates")
            self._series = _series.ravel()
            self.xdata = self._series.dates
            # TODO: Mmh, what's going on with the line below ?
            self.xaxis.set_major_locator
        else:
            self._series = None
            self.xdata = None
        self._austoscale = False
        # Get the data to plot
        self.legendsymbols = []
        self.legendlabels = []
        # keep track of axis format and tick info
        self.date_axis_info = None
        # used to keep track of current view interval to determine if we need
        # to reset date_axis_info
        self.view_interval = None
Ejemplo n.º 2
0
    def __init__(self, fig=None, *args, **kwargs):

        # Retrieve the series ...................
        _series = kwargs.pop('series', getattr(fig, 'series', None))
        Subplot.__init__(self, fig, *args, **kwargs)

        # Process options .......................
        if _series is not None:
            assert hasattr(_series, "dates")
            self._series = _series.ravel()
            self.xdata = self._series.dates
            # TODO: Mmh, what's going on with the line below ?
            self.xaxis.set_major_locator
        else:
            self._series = None
            self.xdata = None
        self._austoscale = False
        # Get the data to plot
        self.legendsymbols = []
        self.legendlabels = []
        # keep track of axis format and tick info
        self.date_axis_info = None
        # used to keep track of current view interval to determine if we need
        # to reset date_axis_info
        self.view_interval = None
Ejemplo n.º 3
0
    def __init__(self, fig=None, *args, **kwargs):
        """
Accepts the same keywords as a standard subplot, plus a specific `series` keyword.

:Parameters:
    `fig` : Figure
        Base figure.

:Keywords:
    `series` : TimeSeries
        Data to plot

        """
        # Retrieve the series ...................
        _series = kwargs.pop('series',None)
        Subplot.__init__(self,fig,*args,**kwargs)
#        # Force fig to be defined .....
#        if fig is None:
#            fig = TSFigure(_series)
        # Process options .......................
        if _series is not None:
            assert hasattr(_series, "dates")
            self._series = _series.ravel()
            self.xdata = _series.dates
            self.freq = _series.dates.freq
            self.xaxis.set_major_locator

        else:
            self._series = None
            self.xdata = None
            self.freq = None
        self._austoscale = False
        # Get the data to plot
        self.legendsymbols = []
        self.legendlabels = []
Ejemplo n.º 4
0
    def __init__(self, fig=None, *args, **kwargs):
        """Initializes instance.
        
    Parameters
    ----------
    fig : {None, figure instance}
        Figure from which the plot will depend.
        If None, the current figure is selected.
    series : ClimateSeries
        Series to convert.
    freq : {var}, optional
        A valid frequency specifier (as a string or integer), or a 3-letter 
        string corresponding to the first quarter of the year.
        Use this parameter if the series does not have an adequate frequency.
    func : {None,function}, optional
        Function controlling how data sharing the same new dates should be
        manipulated.
        This function should handle masked values appropriately.
    kwargs : dictionary
        Dictionary of optional parameters.
        The same parameters as for a standard subplot instantiation are recognized.

    See Also
    --------
    scikits.hydroclimpy.periodize
        Function to convert a series into a 2D series with years as rows and
        periods as columns.
        """
        # Initialize the plot ..............
        fig = fig or kwargs.pop('fig', None)
        if fig is None:
            fig = pyplot.gcf()
        elif not isinstance(fig, Figure):
            fig = pyplot.figure(fig)
        if len(args) == 0:
            args = (111,)
        # Get the information about the series
        if not hasattr(series, 'ensoindices'):
            errmsg = "ENSO indices should be defined for the input series!"
            raise AttributeError(errmsg)
        series = kwargs.pop('series', None)
        freq = kwargs.pop('freq', None)
        func = kwargs.pop('func', None)
        self.series = periodize(series, freq=freq, func=func)
        self.cold = self.series.cold
        self.neutral = self.series.neutral
        self.warm = self.series.warm
        self.freq = check_freq(self.series._dates.freq)
        self.positions = np.arange(self.series.shape[-1])
        self.periodlabels = self.series.optinfo['period_names']
        Subplot.__init__(self, fig, *args, **kwargs)
Ejemplo n.º 5
0
    def __init__(self, fig=None, *args, **kwargs):
        """Initializes instance.
        
    Parameters
    ----------
    fig : {None, figure instance}
        Figure from which the plot will depend.
        If None, the current figure is selected.
    series : ClimateSeries
        Series to convert.
    freq : {var}, optional
        A valid frequency specifier (as a string or integer), or a 3-letter 
        string corresponding to the first quarter of the year.
        Use this parameter if the series does not have an adequate frequency.
    func : {None,function}, optional
        Function controlling how data sharing the same new dates should be
        manipulated.
        This function should handle masked values appropriately.
    kwargs : dictionary
        Dictionary of optional parameters.
        The same parameters as for a standard subplot instantiation are recognized.

    See Also
    --------
    scikits.hydroclimpy.periodize
        Function to convert a series into a 2D series with years as rows and
        periods as columns.
        """
        # Initialize the plot ..............
        fig = fig or kwargs.pop('fig', None)
        if fig is None:
            fig = pyplot.gcf()
        elif not isinstance(fig, Figure):
            fig = pyplot.figure(fig)
        if len(args) == 0:
            args = (111, )
        # Get the information about the series
        if not hasattr(series, 'ensoindices'):
            errmsg = "ENSO indices should be defined for the input series!"
            raise AttributeError(errmsg)
        series = kwargs.pop('series', None)
        freq = kwargs.pop('freq', None)
        func = kwargs.pop('func', None)
        self.series = periodize(series, freq=freq, func=func)
        self.cold = self.series.cold
        self.neutral = self.series.neutral
        self.warm = self.series.warm
        self.freq = check_freq(self.series._dates.freq)
        self.positions = np.arange(self.series.shape[-1])
        self.periodlabels = self.series.optinfo['period_names']
        Subplot.__init__(self, fig, *args, **kwargs)
Ejemplo n.º 6
0
    def __init__(self, find_source, parent, *args, **kwargs):
        Subplot.__init__(self, parent.figure, *args, **kwargs)
        self.signals = {}
        self.parent = parent
        self.paused = False
        self.autoscale = True
        self.static = False

        self.find_source = find_source
        
        self.set_title_action = QtGui.QAction("Set plot title", parent)
        self.adjust_axes_action = QtGui.QAction("Adjust plot axes", parent)
        self.adjust_signals_action = QtGui.QAction("Change signals plotted", parent)

        link(self.set_title_action.triggered, self.adjust_title)
        link(self.adjust_axes_action.triggered, self.adjust_axes)
        link(self.adjust_signals_action.triggered, self.adjust_signals)
Ejemplo n.º 7
0
    def __init__(self, fig=None, *args, **kwargs):

        # Retrieve the series ...................
        _series = kwargs.pop('series', getattr(fig, 'series', None))
        Subplot.__init__(self, fig, *args, **kwargs)

        # Process options .......................
        self.set_series(series=_series)

        self._austoscale = False
        # Get the data to plot
        self.legendsymbols = []
        self.legendlabels = []
        # keep track of axis format and tick info
        self.date_axis_info = None
        # used to keep track of current view interval to determine if we need
        # to reset date_axis_info
        self.view_interval = None
Ejemplo n.º 8
0
 def __init__(self, fig, *args, **kwargs):
     Subplot.__init__(self,fig,*args,**kwargs)
     print "Hello, MultichannelSubplot here."
Ejemplo n.º 9
0
 def __init__(self, fig, *args, **kwargs):
     Subplot.__init__(self, fig, *args, **kwargs)
     print "Hello, MultichannelSubplot here."