Exemplo n.º 1
0
 def _figure_format_changed(self, name, old, new):
     from IPython.core.pylabtools import select_figure_format
     if new in {"jpg", "jpeg"}:
         if not pil_available():
             raise TraitError("Requires PIL/Pillow for JPG figures")
     if self.shell is None:
         return
     else:
         select_figure_format(self.shell, new)
Exemplo n.º 2
0
 def _figure_format_changed(self, name, old, new):
     from IPython.core.pylabtools import select_figure_format
     if new in {"jpg", "jpeg"}:
         if not pil_available():
             raise TraitError("Requires PIL/Pillow for JPG figures")
     if self.shell is None:
         return
     else:
         select_figure_format(self.shell, new)
Exemplo n.º 3
0
 def _figure_format_changed(self, name, old, new):
     from IPython.core.pylabtools import select_figure_format
     if self.shell is None:
         return
     else:
         select_figure_format(self.shell, new)
Exemplo n.º 4
0
 def _figure_format_changed(self, name, old, new):
     if self.shell is None:
         return
     else:
         select_figure_format(self.shell, new)
Exemplo n.º 5
0
 def _figure_format_changed(self, name, old, new):
     if self.shell is None:
         return
     else:
         select_figure_format(self.shell, new)
Exemplo n.º 6
0
 def _figure_format_changed(self, name, old, new):
     from IPython.core.pylabtools import select_figure_format
     if self.shell is None:
         return
     else:
         select_figure_format(self.shell, new)
Exemplo n.º 7
0
def disable_retina(ip):
    from matplotlib.figure import Figure
    from IPython.core.pylabtools import select_figure_format
    select_figure_format(ip, 'png')
    html_formatter = ip.display_formatter.formatters['text/html']
    html_formatter.type_printers.pop(Figure, None)