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

Upgrade of graphs to Matplotlib 1.5.0 #209

Closed
finmod opened this issue Nov 16, 2015 · 3 comments
Closed

Upgrade of graphs to Matplotlib 1.5.0 #209

finmod opened this issue Nov 16, 2015 · 3 comments

Comments

@finmod
Copy link

finmod commented Nov 16, 2015

In the recent upgrade of Matplotlib from 1.4.3 to 1.5.0 introduced in Anaconda3 2.4.0 (python 3.5), there are quite few modifications in the style of designing graphs. The following error appears in the lakemodel example and in a few other examples and solutions:

AttributeError Traceback (most recent call last)
/home/denis/Github/QuantEcon.py-master/examples/lakemodel_example.py in ()
36 plt.figure(figsize=[10,9])
37 plt.subplot(3,1,1)
---> 38 plt.plot(X_path[:,0])
39 plt.title(r'Employment')
40 plt.subplot(3,1,2)

/home/denis/anaconda3/lib/python3.5/site-packages/matplotlib/pyplot.py in plot(_args, *_kwargs)
3152 ax.hold(hold)
3153 try:
-> 3154 ret = ax.plot(_args, *_kwargs)
3155 finally:
3156 ax.hold(washold)

/home/denis/anaconda3/lib/python3.5/site-packages/matplotlib/init.py in inner(ax, _args, *_kwargs)
1809 warnings.warn(msg % (label_namer, func.name),
1810 RuntimeWarning, stacklevel=2)
-> 1811 return func(ax, _args, *_kwargs)
1812 pre_doc = inner.doc
1813 if pre_doc is None:

/home/denis/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_axes.py in plot(self, _args, *_kwargs)
1425 kwargs['color'] = c
1426
-> 1427 for line in self._get_lines(_args, *_kwargs):
1428 self.add_line(line)
1429 lines.append(line)

/home/denis/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in _grab_next_args(self, _args, *_kwargs)
384 return
385 if len(remaining) <= 3:
--> 386 for seg in self._plot_args(remaining, kwargs):
387 yield seg
388 return

/home/denis/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in _plot_args(self, tup, kwargs)
372 ncx, ncy = x.shape[1], y.shape[1]
373 for j in xrange(max(ncx, ncy)):
--> 374 seg = func(x[:, j % ncx], y[:, j % ncy], kw, kwargs)
375 ret.append(seg)
376 return ret

/home/denis/anaconda3/lib/python3.5/site-packages/matplotlib/axes/_base.py in _makeline(self, x, y, kw, kwargs)
278 default_dict = self._getdefaults(None, kw, kwargs)
279 self._setdefaults(default_dict, kw, kwargs)
--> 280 seg = mlines.Line2D(x, y, *_kw)
281 self.set_lineprops(seg, *_kwargs)
282 return seg

/home/denis/anaconda3/lib/python3.5/site-packages/matplotlib/lines.py in init(self, xdata, ydata, linewidth, linestyle, color, marker, markersize, markeredgewidth, markeredgecolor, markerfacecolor, markerfacecoloralt, fillstyle, antialiased, dash_capstyle, solid_capstyle, dash_joinstyle, solid_joinstyle, pickradius, drawstyle, markevery, **kwargs)
364 # update kwargs before updating data to give the caller a
365 # chance to init axes (and hence unit support)
--> 366 self.update(kwargs)
367 self.pickradius = pickradius
368 self.ind_offset = 0

/home/denis/anaconda3/lib/python3.5/site-packages/matplotlib/artist.py in update(self, props)
854 func = getattr(self, 'set_' + k, None)
855 if func is None or not six.callable(func):
--> 856 raise AttributeError('Unknown property %s' % k)
857 func(v)
858 changed = True

AttributeError: Unknown property color_cycle

@oyamad
Copy link
Member

oyamad commented Nov 19, 2015

@finmod Thank you for the report. I reproduced the error.

It seems

pd.set_option('display.mpl_style', 'default') # Make the graphs a bit prettier

on line 14 conflicts with Matplotlib 1.5.0. As a quick fix, commenting out this line should make the code work.

@jstac
Copy link
Contributor

jstac commented Nov 19, 2015

@finmod Thanks for letting us know. We're going to upgrade everything to Python 3.5 and latest versions of the libraries over the next few weeks.

@mmcky
Copy link
Contributor

mmcky commented Feb 25, 2016

Thanks @finmod. This has now been fixed and the code in quantecon.applications repo updated.

quantecon/quantecon.applications@a303713e15167d75ef1b0482c8753d53f70a0348

@mmcky mmcky closed this as completed Feb 25, 2016
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

4 participants