module Matplotlib::IRuby::Helper

Constants

BytesIO

Public Instance Methods

register_formats() click to toggle source
# File lib/matplotlib/iruby.rb, line 93
def register_formats
  type { Figure }
  AGG_FORMATS.each do |mime, format|
    format mime do |fig|
      unless fig.canvas.get_supported_filetypes.has_key?(format)
        raise Error, "Unable to display a figure in #{format} format"
      end
      io = BytesIO.new
      fig.canvas.print_figure(io, format: format, bbox_inches: 'tight')
      io.getvalue
    end
  end
end