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

Make rick.chart.line_chart's baseline param optional #13

Closed
chmnata opened this issue Oct 24, 2019 · 0 comments
Closed

Make rick.chart.line_chart's baseline param optional #13

chmnata opened this issue Oct 24, 2019 · 0 comments

Comments

@chmnata
Copy link

chmnata commented Oct 24, 2019

Function line_chart(data, ylab, xlab, **kwargs) currently is not taking baseline parameter as optional.

Documentation and reproducible example here

Error returned when using line_chart(data, ylab, xlab) without baseline=total[count]

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-293-3d92fba8004c> in <module>
     24 total2=pandasql.read_sql(query, con)
     25 
---> 26 fig, ax, props = rick.charts.line_chart(total['count'], 'Trips', 'Time')

/etc/jupyterhub/.venv/src/rick/charts/rick.py in line_chart(data, ylab, xlab, **kwargs)
    279         fig, ax =plt.subplots()
    280         ax.plot(data ,linewidth=3, color = colour.purple)
--> 281         ax.plot(baseline ,linewidth=3, color = colour.grey)
    282 
    283         plt.grid()

/etc/jupyterhub/.venv/lib/python3.5/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
   1808                         "the Matplotlib list!)" % (label_namer, func.__name__),
   1809                         RuntimeWarning, stacklevel=2)
-> 1810             return func(ax, *args, **kwargs)
   1811 
   1812         inner.__doc__ = _add_data_doc(inner.__doc__,

/etc/jupyterhub/.venv/lib/python3.5/site-packages/matplotlib/axes/_axes.py in plot(self, scalex, scaley, *args, **kwargs)
   1609         kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D._alias_map)
   1610 
-> 1611         for line in self._get_lines(*args, **kwargs):
   1612             self.add_line(line)
   1613             lines.append(line)

/etc/jupyterhub/.venv/lib/python3.5/site-packages/matplotlib/axes/_base.py in _grab_next_args(self, *args, **kwargs)
    391                 this += args[0],
    392                 args = args[1:]
--> 393             yield from self._plot_args(this, kwargs)
    394 
    395 

/etc/jupyterhub/.venv/lib/python3.5/site-packages/matplotlib/axes/_base.py in _plot_args(self, tup, kwargs)
    351         # downstream.
    352         if any(v is None for v in tup):
--> 353             raise ValueError("x, y, and format string must not be None")
    354 
    355         kw = {}

ValueError: x, y, and format string must not be None
radumas added a commit that referenced this issue Oct 24, 2019
@radumas radumas closed this as completed Oct 24, 2019
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