SaveFigureOptionsWidget

class menpo.visualize.widgets.SaveFigureOptionsWidget(renderer, file_format='png', dpi=None, orientation='portrait', papertype='letter', transparent=False, facecolour='w', edgecolour='w', pad_inches=0.0, overwrite=False, style='minimal')[source]

Bases: FlexBox

Creates a widget for saving a figure to file. The widget consists of the following parts from IPython.html.widgets and menpo.visualize.widgets.tools:

No Object Variable (self.) Description
1 Select file_format_select Image format selector
2 FloatText dpi_text DPI selector
3 Dropdown orientation_dropdown Paper orientation selector
4 Select papertype_select Paper type selector
5 Checkbox transparent_checkbox Transparency setter
6 ColourSelectionWidget facecolour_widget Face colour selector
7 ColourSelectionWidget edgecolour_widget Edge colour selector
8 FloatText pad_inches_text Padding in inches setter
9 Text filename_text Path and filename
10 Checkbox overwrite_checkbox Overwrite flag
11 Latex error_latex Error message area
12 Button save_button Save button
13 VBox path_box Contains 9, 1, 10, 4
14 VBox page_box Contains 3, 2, 8
15 VBox colour_box Contains 6, 7, 5
16 Tab options_tabs Contains 13, 14, 15
17 HBox save_box Contains 12, 11
18 VBox options_box Contains 16, 17

To set the styling please refer to the style() and predefined_style() methods.

Parameters:
  • renderer (Renderer class or subclass) – The renderer object that was used to render the figure.
  • file_format (str, optional) – The initial value of the file format.
  • dpi (float or None, optional) – The initial value of the dpi. If None, then dpi is set to 0.
  • orientation ({'portrait', 'landscape'}, optional) – The initial value of the orientation.
  • papertype (str, optional) –

    The initial value of the paper type. Possible options are

    {'letter', 'legal', 'executive', 'ledger', 'a0', 'a1', 'a2', 'a3',
     'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10', 'b0', 'b1', 'b2', 'b3',
     'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'b10'}
    
  • transparent (bool, optional) – The initial value of the transparency flag.
  • facecolour (str or list of float, optional) – The initial value of the face colour.
  • edgecolour (str or list of float, optional) – The initial value of the edge colour.
  • pad_inches (float, optional) – The initial value of the figure padding in inches.
  • overwrite (bool, optional) – The initial value of the overwrite flag.
  • style (See Below, optional) –

    Sets a predefined style at the widget. Possible options are

    Style Description
    ‘minimal’ Simple black and white style
    ‘success’ Green-based style
    ‘info’ Blue-based style
    ‘warning’ Yellow-based style
    ‘danger’ Red-based style
    ‘’ No style
predefined_style(style)[source]

Function that sets a predefined style on the widget.

Parameters:style (str (see below)) –

Style options

Style Description
‘minimal’ Simple black and white style
‘success’ Green-based style
‘info’ Blue-based style
‘warning’ Yellow-based style
‘danger’ Red-based style
‘’ No style
style(box_style=None, border_visible=False, border_color='black', border_style='solid', border_width=1, border_radius=0, padding=0, margin=0, font_family='', font_size=None, font_style='', font_weight='')[source]

Function that defines the styling of the widget.

Parameters:
  • box_style (See Below, optional) –

    Style options

    Style Description
    ‘success’ Green-based style
    ‘info’ Blue-based style
    ‘warning’ Yellow-based style
    ‘danger’ Red-based style
    ‘’ Default style
    None No style
  • border_visible (bool, optional) – Defines whether to draw the border line around the widget.
  • border_color (str, optional) – The color of the border around the widget.
  • border_style (str, optional) – The line style of the border around the widget.
  • border_width (float, optional) – The line width of the border around the widget.
  • border_radius (float, optional) – The radius of the corners of the box.
  • padding (float, optional) – The padding around the widget.
  • margin (float, optional) – The margin around the widget.
  • font_family (See Below, optional) –

    The font family to be used. Example options

    {'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace',
     'helvetica'}
    
  • font_size (int, optional) – The font size.
  • font_style ({'normal', 'italic', 'oblique'}, optional) – The font style.
  • font_weight (See Below, optional) –

    The font weight. Example options

    {'ultralight', 'light', 'normal', 'regular', 'book', 'medium',
     'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy',
     'extra bold', 'black'}