You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run this code in Jupyter Notebook with the Ubuntu operating system:
fig, ax1 = plt.subplots(nrows=1, figsize=(10,5))
ax1.boxplot(df['est'], labels = ['Boxplot 1'])
ax1.set_title('Diagrama de caja')
ax1.set_xlabel('Representación de la variable 1 del dataframe')
ax1.set_ylabel('Valores')
After having importing and reading the dataset as df:
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
from matplotlib import rcParams
rcParams['figure.figsize'] = (16, 9)
I get the following error: Can anyone help me?
Error in callback <function post_execute at 0x7f6c4b198398> (for post_execute):
/home/miriam/.local/lib/python2.7/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.canvas.draw_idle()
137
138 atexit.register(Gcf.destroy_all)
/home/miriam/.local/lib/python2.7/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):
/home/miriam/.local/lib/python2.7/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.
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/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
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/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
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in draw(self, renderer)
704
705 with _wrap_text(self) as textobj:
--> 706 bbox, info, descent = textobj._get_layout(renderer)
707 trans = textobj.get_transform()
708
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in _get_layout(self, renderer)
303 baseline = 0
304 for i, line in enumerate(lines):
--> 305 clean_line, ismath = self.is_math_text(line, self.get_usetex())
306 if clean_line:
307 w, h, d = renderer.get_text_width_height_descent(clean_line,
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in is_math_text(s, usetex)
1186 return s, 'TeX'
1187
-> 1188 if cbook.is_math_text(s):
1189 return s, True
1190 else:
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/cbook/init.pyc in is_math_text(s)
2033 except UnicodeDecodeError:
2034 raise ValueError(
-> 2035 "matplotlib display text must have all code points < 128 or use "
2036 "Unicode strings")
2037
ValueError: matplotlib display text must have all code points < 128 or use Unicode strings
/home/miriam/.local/lib/python2.7/site-packages/IPython/core/pylabtools.pyc in (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))
/home/miriam/.local/lib/python2.7/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':
/home/miriam/.local/lib/python2.7/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.
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/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
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/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
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in draw(self, renderer)
704
705 with _wrap_text(self) as textobj:
--> 706 bbox, info, descent = textobj._get_layout(renderer)
707 trans = textobj.get_transform()
708
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in _get_layout(self, renderer)
303 baseline = 0
304 for i, line in enumerate(lines):
--> 305 clean_line, ismath = self.is_math_text(line, self.get_usetex())
306 if clean_line:
307 w, h, d = renderer.get_text_width_height_descent(clean_line,
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in is_math_text(s, usetex)
1186 return s, 'TeX'
1187
-> 1188 if cbook.is_math_text(s):
1189 return s, True
1190 else:
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/cbook/init.pyc in is_math_text(s)
2033 except UnicodeDecodeError:
2034 raise ValueError(
-> 2035 "matplotlib display text must have all code points < 128 or use "
2036 "Unicode strings")
2037
ValueError: matplotlib display text must have all code points < 128 or use Unicode strings
When I run this code in Jupyter Notebook with the Ubuntu operating system:
fig, ax1 = plt.subplots(nrows=1, figsize=(10,5))
ax1.boxplot(df['est'], labels = ['Boxplot 1'])
ax1.set_title('Diagrama de caja')
ax1.set_xlabel('Representación de la variable 1 del dataframe')
ax1.set_ylabel('Valores')
After having importing and reading the dataset as df:
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
from matplotlib import rcParams
rcParams['figure.figsize'] = (16, 9)
I get the following error: Can anyone help me?
Error in callback <function post_execute at 0x7f6c4b198398> (for post_execute):
ValueError Traceback (most recent call last)
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/pyplot.pyc in post_execute()
147 def post_execute():
148 if matplotlib.is_interactive():
--> 149 draw_all()
150
151 # IPython >= 2
/home/miriam/.local/lib/python2.7/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.canvas.draw_idle()
137
138 atexit.register(Gcf.destroy_all)
/home/miriam/.local/lib/python2.7/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):
/home/miriam/.local/lib/python2.7/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.
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/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')
/home/miriam/.local/lib/python2.7/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
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/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')
/home/miriam/.local/lib/python2.7/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
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/axis.pyc in draw(self, renderer, *args, **kwargs)
1202 self._update_label_position(renderer)
1203
-> 1204 self.label.draw(renderer)
1205
1206 self._update_offset_text_position(ticklabelBoxes, ticklabelBoxes2)
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in draw(self, renderer)
704
705 with _wrap_text(self) as textobj:
--> 706 bbox, info, descent = textobj._get_layout(renderer)
707 trans = textobj.get_transform()
708
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in _get_layout(self, renderer)
303 baseline = 0
304 for i, line in enumerate(lines):
--> 305 clean_line, ismath = self.is_math_text(line, self.get_usetex())
306 if clean_line:
307 w, h, d = renderer.get_text_width_height_descent(clean_line,
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in is_math_text(s, usetex)
1186 return s, 'TeX'
1187
-> 1188 if cbook.is_math_text(s):
1189 return s, True
1190 else:
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/cbook/init.pyc in is_math_text(s)
2033 except UnicodeDecodeError:
2034 raise ValueError(
-> 2035 "matplotlib display text must have all code points < 128 or use "
2036 "Unicode strings")
2037
ValueError: matplotlib display text must have all code points < 128 or use Unicode strings
ValueError Traceback (most recent call last)
/home/miriam/.local/lib/python2.7/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)
/home/miriam/.local/lib/python2.7/site-packages/IPython/core/pylabtools.pyc in (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))
/home/miriam/.local/lib/python2.7/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':
/home/miriam/.local/lib/python2.7/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)
/home/miriam/.local/lib/python2.7/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
/home/miriam/.local/lib/python2.7/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.
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/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')
/home/miriam/.local/lib/python2.7/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
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/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')
/home/miriam/.local/lib/python2.7/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
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/axis.pyc in draw(self, renderer, *args, **kwargs)
1202 self._update_label_position(renderer)
1203
-> 1204 self.label.draw(renderer)
1205
1206 self._update_offset_text_position(ticklabelBoxes, ticklabelBoxes2)
/home/miriam/.local/lib/python2.7/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:
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in draw(self, renderer)
704
705 with _wrap_text(self) as textobj:
--> 706 bbox, info, descent = textobj._get_layout(renderer)
707 trans = textobj.get_transform()
708
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in _get_layout(self, renderer)
303 baseline = 0
304 for i, line in enumerate(lines):
--> 305 clean_line, ismath = self.is_math_text(line, self.get_usetex())
306 if clean_line:
307 w, h, d = renderer.get_text_width_height_descent(clean_line,
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/text.pyc in is_math_text(s, usetex)
1186 return s, 'TeX'
1187
-> 1188 if cbook.is_math_text(s):
1189 return s, True
1190 else:
/home/miriam/.local/lib/python2.7/site-packages/matplotlib/cbook/init.pyc in is_math_text(s)
2033 except UnicodeDecodeError:
2034 raise ValueError(
-> 2035 "matplotlib display text must have all code points < 128 or use "
2036 "Unicode strings")
2037
ValueError: matplotlib display text must have all code points < 128 or use Unicode strings
fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(10,5))
ax2.boxplot(df['est'], labels = ['Boxplot 2'])
The text was updated successfully, but these errors were encountered: