def extension(self): return self.name
return None
raise NotImplementedError
raise NotImplementedError
optional=True, help='DPI of the figure') optional=True, help='Size in pixels') optional=True, help='Width in pixels') optional=True, help='Height in pixels')
def extension(self): return 'd%i.png' % self.dpi return 's%i.png' % self.size_pixels return 'w%i.png' % self.width_pixels return 'h%i.png' % self.height_pixels else:
return self.dpi return min(self.size_pixels/w_inch, self.size_pixels/h_inch) return self.width_pixels/w_inch return self.height_pixels/h_inch else:
default=150, help='DPI of the figure')
return self.dpi
return fig.savefig(path, format=self.name, **kwargs)
return automap.save(path, **kwargs)
default=150, help='DPI of the figure')
return self.dpi
return fig.savefig(path, format=self.name, **kwargs)
return automap.save(path, **kwargs)
def extension(self): return 'html'
import mpld3 kwargs.pop('dpi')
mpld3.save_html( fig, fileobj=path, **kwargs)
default='default', help='Variant of the plot (if applicable)') PlotFormat.T(), default=[PNG()], help='Format of the plot') 2, Float.T(), help='size of the plot') default=10., help='font size')
def size_inch(self):
pass
def load(cls, path): from grond.plot import get_all_plot_classes get_all_plot_classes() # make sure all plot classes are loaded collection = load(filename=path) if not isinstance(collection, PlotConfigCollection): raise GrondError( 'invalid plot collection configuration in file "%s"' % path)
return collection
'''Get subset of plot configs supported by the current environment.'''
clone(pc) for pc in self.plot_configs if pc.__class__ in plot_classes]
'PlotFormat', 'PNG', 'PDF', 'PlotConfig', 'PlotConfigCollection', ] |