Beispiel #1
0
 def __call__(self, *args, **kwargs):
     data = self._parent.copy()
     kind = kwargs.pop("kind", "geo")
     if kind == "geo":
         return plot_dataframe(data, *args, **kwargs)
     if kind in self._pandas_kinds:
         # Access pandas plots
         return PlotAccessor(data)(kind=kind, **kwargs)
     else:
         # raise error
         raise ValueError(f"{kind} is not a valid plot kind")
Beispiel #2
0
 def __call__(self, *arguments, **keywords):
     data = self._parent.copy()
     kind = keywords.pop('kind', 'scatter')
     if kind == 'scatter':
         return plot_scatter(data, *arguments, **keywords)
     elif kind == 'scatter2':
         return plot_scatter2(data, *arguments, **keywords)
     elif kind == 'schedule':
         return plot_schedule(data, *arguments, **keywords)
     elif kind in self._pandas_kinds:
         return PlotAccessor(data)(kind=kind, **keywords)
     else:
         raise ValueError(f'{kind} is not a valid plot kind')
Beispiel #3
0
def plot_scatter(rbdf, **keywords):
    if 'alpha' not in keywords:
        keywords['alpha'] = 0.25
    if 'figsize' not in keywords:
        keywords['figsize'] = default_figsize
    if 'grid' not in keywords:
        keywords['grid'] = True
    if 'loglog' not in keywords:
        keywords['loglog'] = True
    if keywords['loglog']:
        rbdf = rbdf.replace(to_replace=0.0, value=0.005)
    ax = PlotAccessor(rbdf)(kind='scatter', **keywords)
    low_x, high_x = ax.get_xlim()
    low_y, high_y = ax.get_ylim()
    low = max(low_x, low_y)
    high = min(high_x, high_y)
    ax.axline([low, low], [high, high], c='k', linewidth=0.1)
    return ax