Closed
Description
Bug report
Bug summary
Matplotlib can't plot a Dataset in Windows 10
Code for reproduction
fig = plt.figure(figsize=(12, 5))
totalSum = dataset.sum(axis=1).sort_values(ascending=False)
totalSum.plot(kind='bar', style='b', alpha=0.4,
title='Total Values for Sales')
Actual outcome
Out[9]:
<matplotlib.axes._subplots.AxesSubplot at 0xbd760b8>
D:\Python 2.7\lib\site-packages\matplotlib\font_manager.py:1331: UserWarning: findfont: Font family [u'times'] not found. Falling back to DejaVu Sans
(prop.get_family(), self.defaultFamily[fontext]))
Error in callback <function post_execute at 0x000000000B679278> (for post_execute):
---------------------------------------------------------------------------
WindowsError Traceback (most recent call last)
D:\Python 2.7\lib\site-packages\matplotlib\pyplot.pyc in post_execute()
147 def post_execute():
148 if matplotlib.is_interactive():
--> 149 draw_all()
150
151 # IPython >= 2
D:\Python 2.7\lib\site-packages\matplotlib\_pylab_helpers.pyc in draw_all(cls, force)
134 for f_mgr in cls.get_all_fig_managers():
135 if force or f_mgr.canvas.figure.stale:
--> 136 f_mgr.
C333
canvas.draw_idle()
137
138 atexit.register(Gcf.destroy_all)
D:\Python 2.7\lib\site-packages\matplotlib\backend_bases.pyc in draw_idle(self, *args, **kwargs)
2053 if not self._is_idle_drawing:
2054 with self._idle_draw_cntx():
-> 2055 self.draw(*args, **kwargs)
2056
2057 def draw_cursor(self, event):
D:\Python 2.7\lib\site-packages\matplotlib\backends\backend_agg.pyc in draw(self)
435 # if toolbar:
436 # toolbar.set_cursor(cursors.WAIT)
--> 437 self.figure.draw(self.renderer)
438 # A GUI class may be need to update a window using this draw, so
439 # don't forget to call the superclass.
D:\Python 2.7\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:
D:\Python 2.7\lib\site-packages\matplotlib\figure.pyc in draw(self, renderer)
1491
1492 mimage._draw_list_compositing_images(
-> 1493 renderer, self, artists, self.suppressComposite)
1494
1495 renderer.close_group('figure')
D:\Python 2.7\lib\site-packages\matplotlib\image.pyc in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
139 if not_composite or not has_images:
140 for a in artists:
--> 141 a.draw(renderer)
142 else:
143 # Composite any adjacent images together
D:\Python 2.7\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:
D:\Python 2.7\lib\site-packages\matplotlib\axes\_base.pyc in draw(self, renderer, inframe)
2633 renderer.stop_rasterizing()
2634
-> 2635 mimage._draw_list_compositing_images(renderer, self, artists)
2636
2637 renderer.close_group('axes')
D:\Python 2.7\lib\site-packages\matplotlib\image.pyc in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
139 if not_composite or not has_images:
140 for a in artists:
--> 141 a.draw(renderer)
142 else:
143 # Composite any adjacent images together
D:\Python 2.7\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:
D:\Python 2.7\lib\site-packages\matplotlib\axis.pyc in draw(self, renderer, *args, **kwargs)
1190 ticks_to_draw = self._update_ticks(renderer)
1191 ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,
-> 1192 renderer)
1193
1194 for tick in ticks_to_draw:
D:\Python 2.7\lib\site-packages\matplotlib\axis.pyc in _get_tick_bboxes(self, ticks, renderer)
1128 for tick in ticks:
1129 if tick.label1On and tick.label1.get_visible():
-> 1130 extent = tick.label1.get_window_extent(renderer)
1131 ticklabelBoxes.append(extent)
1132 if tick.label2On and tick.label2.get_visible():
D:\Python 2.7\lib\site-packages\matplotlib\text.pyc in get_window_extent(self, renderer, dpi)
920 raise RuntimeError('Cannot get window extent w/o renderer')
921
--> 922 bbox, info, descent = self._get_layout(self._renderer)
923 x, y = self.get_unitless_position()
924 x, y = self.get_transform().transform_point((x, y))
D:\Python 2.7\lib\site-packages\matplotlib\text.pyc in _get_layout(self, renderer)
307 w, h, d = renderer.get_text_width_height_descent(clean_line,
308 self._fontproperties,
--> 309 ismath=ismath)
310 else:
311 w, h, d = 0, 0, 0
D:\Python 2.7\lib\site-packages\matplotlib\backends\backend_agg.pyc in get_text_width_height_descent(self, s, prop, ismath)
234 fontsize = prop.get_size_in_points()
235 w, h, d = texmanager.get_text_width_height_descent(
--> 236 s, fontsize, renderer=self)
237 return w, h, d
238
D:\Python 2.7\lib\site-packages\matplotlib\texmanager.pyc in get_text_width_height_descent(self, tex, fontsize, renderer)
499 else:
500 # use dviread. It sometimes returns a wrong descent.
--> 501 dvifile = self.make_dvi(tex, fontsize)
502 with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:
503 page = next(iter(dvi))
D:\Python 2.7\lib\site-packages\matplotlib\texmanager.pyc in make_dvi(self, tex, fontsize)
363 self._run_checked_subprocess(
364 ["latex", "-interaction=nonstopmode", "--halt-on-error",
--> 365 texfile], tex)
366 for fname in glob.glob(basefile + '*'):
367 if not fname.endswith(('dvi', 'tex')):
D:\Python 2.7\lib\site-packages\matplotlib\texmanager.pyc in _run_checked_subprocess(self, command, tex)
333 report = subprocess.check_output(command,
334 cwd=self.texcache,
--> 335 stderr=subprocess.STDOUT)
336 except subprocess.CalledProcessError as exc:
337 raise RuntimeError(
D:\Python 2.7\lib\subprocess.pyc in check_output(*popenargs, **kwargs)
565 if 'stdout' in kwargs:
566 raise ValueError('stdout argument not allowed, it will be overridden.')
--> 567 process = Popen(stdout=PIPE, *popenargs, **kwargs)
568 output, unused_err = process.communicate()
569 retcode = process.poll()
D:\Python 2.7\lib\subprocess.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
709 p2cread, p2cwrite,
710 c2pread, c2pwrite,
--> 711 errread, errwrite)
712 except Exception:
713 # Preserve original exception in case os.close raises.
D:\Python 2.7\lib\subprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
957 env,
958 cwd,
--> 959 startupinfo)
960 except pywintypes.error, e:
961 # Translate pywintypes.error to WindowsError, which is
WindowsError: [Error 2] The system cannot find the file specified
---------------------------------------------------------------------------
WindowsError Traceback (most recent call last)
C:\Users\mufidjamaluddin\AppData\Roaming\Python\Python27\site-packages\IPython\core\formatters.pyc in __call__(self, obj)
332 pass
333 else:
--> 334 return printer(obj)
335 # Finally look for special method names
336 method = get_real_method(obj, self.print_method)
C:\Users\mufidjamaluddin\AppData\Roaming\Python\Python27\site-packages\IPython\core\pylabtools.pyc in <lambda>(fig)
245
246 if 'png' in formats:
--> 247 png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))
248 if 'retina' in formats or 'png2x' in formats:
249 png_formatter.for_type(Figure, lambda fig: retina_figure(fig, **kwargs))
C:\Users\mufidjamaluddin\AppData\Roaming\Python\Python27\site-packages\IPython\core\pylabtools.pyc in print_figure(fig, fmt, bbox_inches, **kwargs)
129
130 bytes_io = BytesIO()
--> 131 fig.canvas.print_figure(bytes_io, **kw)
132 data = bytes_io.getvalue()
133 if fmt == 'svg':
D:\Python 2.7\lib\site-packages\matplotlib\backend_bases.pyc in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)
2210 orientation=orientation,
2211 dryrun=True,
-> 2212 **kwargs)
2213 renderer = self.figure._cachedRenderer
2214 bbox_inches = self.figure.get_tightbbox(renderer)
D:\Python 2.7\lib\site-packages\matplotlib\backends\backend_agg.pyc in print_png(self, filename_or_obj, *args, **kwargs)
515
516 def print_png(self, filename_or_obj, *args, **kwargs):
--> 517 FigureCanvasAgg.draw(self)
518 renderer = self.get_renderer()
519 original_dpi = renderer.dpi
D:\Python 2.7\lib\site-packages\matplotlib\backends\backend_agg.pyc in draw(self)
435 # if toolbar:
436 # toolbar.set_cursor(cursors.WAIT)
--> 437 self.figure.draw(self.renderer)
438 # A GUI class may be need to update a window using this draw, so
439 # don't forget to call the superclass.
D:\Python 2.7\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:
D:\Python 2.7\lib\site-packages\matplotlib\figure.pyc in draw(self, renderer)
1491
1492 mimage._draw_list_compositing_images(
-> 1493 renderer, self, artists, self.suppressComposite)
1494
1495 renderer.close_group('figure')
D:\Python 2.7\lib\site-packages\matplotlib\image.pyc in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
139 if not_composite or not has_images:
140 for a in artists:
--> 141 a.draw(renderer)
142 else:
143 # Composite any adjacent images together
D:\Python 2.7\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:
D:\Python 2.7\lib\site-packages\matplotlib\axes\_base.pyc in draw(self, renderer, inframe)
2633 renderer.stop_rasterizing()
2634
-> 2635 mimage._draw_list_compositing_images(renderer, self, artists)
2636
2637 renderer.close_group('axes')
D:\Python 2.7\lib\site-packages\matplotlib\image.pyc in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
139 if not_composite or not has_images:
140 for a in artists:
--> 141 a.draw(renderer)
142 else:
143 # Composite any adjacent images together
D:\Python 2.7\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs)
53 renderer.start_filter()
54
---> 55 return draw(artist, renderer, *args, **kwargs)
56 finally:
57 if artist.get_agg_filter() is not None:
D:\Python 2.7\lib\site-packages\matplotlib\axis.pyc in draw(self, renderer, *args, **kwargs)
1190 ticks_to_draw = self._update_ticks(renderer)
1191 ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,
-> 1192 renderer)
1193
1194 for tick in ticks_to_draw:
D:\Python 2.7\lib\site-packages\matplotlib\axis.pyc in _get_tick_bboxes(self, ticks, renderer)
1128 for tick in ticks:
1129 if tick.label1On and tick.label1.get_visible():
-> 1130 extent = tick.label1.get_window_extent(renderer)
1131 ticklabelBoxes.append(extent)
1132 if tick.label2On and tick.label2.get_visible():
D:\Python 2.7\lib\site-packages\matplotlib\text.pyc in get_window_extent(self, renderer, dpi)
920 raise RuntimeError('Cannot get window extent w/o renderer')
921
--> 922 bbox, info, descent = self._get_layout(self._renderer)
923 x, y = self.get_unitless_position()
924 x, y = self.get_transform().transform_point((x, y))
D:\Python 2.7\lib\site-packages\matplotlib\text.pyc in _get_layout(self, renderer)
307 w, h, d = renderer.get_text_width_height_descent(clean_line,
308 self._fontproperties,
--> 309 ismath=ismath)
310 else:
311 w, h, d = 0, 0, 0
D:\Python 2.7\lib\site-packages\matplotlib\backends\backend_agg.pyc in get_text_width_height_descent(self, s, prop, ismath)
234 fontsize = prop.get_size_in_points()
235 w, h, d = texmanager.get_text_width_height_descent(
--> 236 s, fontsize, renderer=self)
237 return w, h, d
238
D:\Python 2.7\lib\site-packages\matplotlib\texmanager.pyc in get_text_width_height_descent(self, tex, fontsize, renderer)
499 else:
500 # use dviread. It sometimes returns a wrong descent.
--> 501 dvifile = self.make_dvi(tex, fontsize)
502 with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:
503 page = next(iter(dvi))
D:\Python 2.7\lib\site-packages\matplotlib\texmanager.pyc in make_dvi(self, tex, fontsize)
363 self._run_checked_subprocess(
364 ["latex", "-interaction=nonstopmode", "--halt-on-error",
--> 365 texfile], tex)
366 for fname in glob.glob(basefile + '*'):
367 if not fname.endswith(('dvi', 'tex')):
D:\Python 2.7\lib\site-packages\matplotlib\texmanager.pyc in _run_checked_subprocess(self, command, tex)
333 report = subprocess.check_output(command,
334 cwd=self.texcache,
--> 335 stderr=subprocess.STDOUT)
336 except subprocess.CalledProcessError as exc:
337 raise RuntimeError(
D:\Python 2.7\lib\subprocess.pyc in check_output(*popenargs, **kwargs)
565 if 'stdout' in kwargs:
566 raise ValueError('stdout argument not allowed, it will be overridden.')
--> 567 process = Popen(stdout=PIPE, *popenargs, **kwargs)
568 output, unused_err = process.communicate()
569 retcode = process.poll()
D:\Python 2.7\lib\subprocess.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
709 p2cread, p2cwrite,
710 c2pread, c2pwrite,
--> 711 errread, errwrite)
712 except Exception:
713 # Preserve original exception in case os.close raises.
D:\Python 2.7\lib\subprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
957 env,
958 cwd,
--> 959 startupinfo)
960 except pywintypes.error, e:
961 # Translate pywintypes.error to WindowsError, which is
WindowsError: [Error 2] The system cannot find the file specified
Expected outcome
A plot of Dataset
Matplotlib version
- Operating system: Windows 10
- Matplotlib version: 1.15.2
- Matplotlib backend (
print(matplotlib.get_backend())
): module://ipykernel.pylab.backend_inline - Python version: 2.7
- Jupyter version : 5.7.0
Metadata
Metadata
Assignees
Labels
No labels