Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fplot does not pass through ylim or title #8

Open
cancan101 opened this issue Apr 17, 2014 · 3 comments
Open

fplot does not pass through ylim or title #8

cancan101 opened this issue Apr 17, 2014 · 3 comments

Comments

@cancan101
Copy link

The same happens with title

----> 1 df.fplot(ylim=[0,1.01])

/usr/lib/python2.7/site-packages/ts_charting/charting.pyc in df_plot(self, *args, **kwargs)
     55     for col in self.columns:
     56         series = self[col]
---> 57         series.fplot(*args, **kwargs)
     58 
     59 pd.DataFrame.fplot = df_plot

/usr/lib/python2.7/site-packages/ts_charting/charting.pyc in series_plot(self, label, *args, **kwargs)
     39 
     40     fig = gcf()
---> 41     fig.plot(str(label), self, *args, **kwargs)
     42 
     43 pd.Series.fplot = series_plot

/usr/lib/python2.7/site-packages/ts_charting/figure.pyc in plot(self, label, series, index, method, **kwargs)
     74         self.figure.tight_layout()
     75         plt.xticks(rotation=30, ha='right')
---> 76         self.grapher.plot(label, series, index, method, **kwargs)
     77 
     78     def plot_markers(self, label, series, yvalues=None, xindex=None, **kwargs):

/usr/lib/python2.7/site-packages/ts_charting/figure.pyc in plot(self, label, series, index, method, secondary_y, **kwargs)
    170 
    171         ax = self.find_ax(secondary_y, kwargs)
--> 172         ax.plot(xax, plot_series, **kwargs)
    173 
    174         # generate combined legend

/usr/lib64/python2.7/site-packages/matplotlib/axes.pyc in plot(self, *args, **kwargs)
   4135         lines = []
   4136 
-> 4137         for line in self._get_lines(*args, **kwargs):
   4138             self.add_line(line)
   4139             lines.append(line)

/usr/lib64/python2.7/site-packages/matplotlib/axes.pyc in _grab_next_args(self, *args, **kwargs)
    315                 return
    316             if len(remaining) <= 3:
--> 317                 for seg in self._plot_args(remaining, kwargs):
    318                     yield seg
    319                 return

/usr/lib64/python2.7/site-packages/matplotlib/axes.pyc in _plot_args(self, tup, kwargs)
    303         ncx, ncy = x.shape[1], y.shape[1]
    304         for j in xrange(max(ncx, ncy)):
--> 305             seg = func(x[:, j % ncx], y[:, j % ncy], kw, kwargs)
    306             ret.append(seg)
    307         return ret

/usr/lib64/python2.7/site-packages/matplotlib/axes.pyc in _makeline(self, x, y, kw, kwargs)
    255                             **kw
    256                             )
--> 257         self.set_lineprops(seg, **kwargs)
    258         return seg
    259 

/usr/lib64/python2.7/site-packages/matplotlib/axes.pyc in set_lineprops(self, line, **kwargs)
    196             funcName = "set_%s" % key
    197             if not hasattr(line, funcName):
--> 198                 raise TypeError('There is no line property "%s"' % key)
    199             func = getattr(line, funcName)
    200             func(val)

TypeError: There is no line property "ylim"

I am able to pass these parameters to the regular plot method.

@cancan101
Copy link
Author

Title can be solved by calling:

fig.ax.title.set_text(title_text)

@cancan101
Copy link
Author

y_lim can be solved with:

_ = fig.ax.set_ylim(lims)

@dalejung
Copy link
Owner

I guess this should be methods on Figure. I tend to have a fig = figure() and don't use fplot bare. I'll have to think about this. glad you found a workaround, might be a bit before I can get my head back in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants