<s> """<STR_LIT>""" <EOL> __version__ = "<STR_LIT>" <EOL> from . import types as S <EOL> from . MplAxisStyle import MplAxisStyle <EOL> from . MplPatchStyle import MplPatchStyle <EOL> from . MplTextStyle import MplTextStyle <EOL> import matplotlib . figure as mplfig <EOL> __all__ = [ '<STR_LIT>' ] <EOL> class MplFigureStyle ( S . SubStyle ) : <EOL> """<STR_LIT>""" <EOL> width = S . property . Float ( min = <NUM_LIT:0.1> , doc = """<STR_LIT>""" ) <EOL> height = S . property . Float ( min = <NUM_LIT:0.1> , doc = """<STR_LIT>""" ) <EOL> dpi = S . property . Integer ( min = <NUM_LIT:1> , doc = """<STR_LIT>""" ) <EOL> bgColor = S . property . Alias ( '<STR_LIT>' , <EOL> doc = "<STR_LIT>" ) <EOL> edgeColor = S . property . Alias ( '<STR_LIT>' , doc = """<STR_LIT>""" ) <EOL> edgeStyle = S . property . Alias ( '<STR_LIT>' , doc = """<STR_LIT>""" ) <EOL> edgeWidth = S . property . Alias ( '<STR_LIT>' , doc = """<STR_LIT>""" ) <EOL> leftMargin = S . property . Float ( min = <NUM_LIT:0.0> , max = <NUM_LIT:1.0> , doc = """<STR_LIT>""" ) <EOL> rightMargin = S . property . Float ( min = <NUM_LIT:0.0> , max = <NUM_LIT:1.0> , doc = """<STR_LIT>""" ) <EOL> topMargin = S . property . Float ( min = <NUM_LIT:0.0> , max = <NUM_LIT:1.0> , doc = """<STR_LIT>""" ) <EOL> bottomMargin = S . property . Float ( min = <NUM_LIT:0.0> , max = <NUM_LIT:1.0> , doc = """<STR_LIT>""" ) <EOL> axesPadX = S . property . Float ( min = <NUM_LIT:0.0> , max = <NUM_LIT:1.0> , doc = """<STR_LIT>""" ) <EOL> axesPadY = S . property . Float ( min = <NUM_LIT:0.0> , max = <NUM_LIT:1.0> , doc = """<STR_LIT>""" ) <EOL> def __init__ ( self , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> self . _patch = MplPatchStyle ( ) <EOL> S . SubStyle . __init__ ( self , ** kwargs ) <EOL> def __copy__ ( self ) : <EOL> """<STR_LIT>""" <EOL> result = S . SubStyle . __copy__ ( self ) <EOL> result . _patch = self . _patch . copy ( ) <EOL> return result <EOL> def apply ( self , obj , defaults = { } , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( obj , mplfig . Figure ) : <EOL> msg = "<STR_LIT>" "<STR_LIT>" "<STR_LIT>" % ( obj , ) <EOL> raise Exception ( msg ) <EOL> defaults = S . lib . resolveDefaults ( defaults , bgColor = self . bgColor ) <EOL> subKwargs = kwargs . get ( '<STR_LIT>' , { } ) <EOL> subDefaults = S . lib . resolveDefaults ( defaults , [ '<STR_LIT>' ] ) <EOL> bgColor = self . getValue ( '<STR_LIT>' , defaults , ** kwargs ) <EOL> if ( ( '<STR_LIT>' in subKwargs ) and ( subKwargs [ '<STR_LIT>' ] is None ) ) or ( '<STR_LIT>' not in subKwargs ) : <EOL> subKwargs [ '<STR_LIT>' ] = kwargs . get ( '<STR_LIT>' , bgColor ) <EOL> self . _patch . apply ( obj . patch , subDefaults , ** subKwargs ) <EOL> subDefaults = S . lib . resolveDefaults ( defaults , <EOL> leftMargin = obj . subplotpars . left , <EOL> rightMargin = <NUM_LIT:1.0> - obj . subplotpars . right , <EOL> topMargin = <NUM_LIT:1.0> - obj . subplotpars . top , <EOL> bottomMargin = obj . subplotpars . bottom , <EOL> axesPadX = obj . subplotpars . wspace , <EOL> axesPadY = obj . subplotpars . hspace ) <EOL> l = self . getValue ( '<STR_LIT>' , subDefaults , ** kwargs ) <EOL> r = self . getValue ( '<STR_LIT>' , subDefaults , ** kwargs ) <EOL> t = self . getValue ( '<STR_LIT>' , subDefaults , ** kwargs ) <EOL> b = self . getValue ( '<STR_LIT>' , subDefaults , ** kwargs ) <EOL> x = self . getValue ( '<STR_LIT>' , subDefaults , ** kwargs ) <EOL> y = self . getValue ( '<STR_LIT>' , subDefaults , ** kwargs ) <EOL> obj . subplots_adjust ( left = l , right = <NUM_LIT:1.0> - r , <EOL> top = <NUM_LIT:1.0> - t , bottom = b , <EOL> wspace = x , hspace = y ) <EOL> width = self . getValue ( '<STR_LIT:width>' , defaults , ** kwargs ) <EOL> if width is None : <EOL> width = obj . get_figwidth ( ) <EOL> height = self . getValue ( '<STR_LIT>' , defaults , ** kwargs ) <EOL> if height is None : <EOL> height = obj . get_figheight ( ) <EOL> obj . set_size_inches ( width , height , forward = True ) <EOL> value = self . getValue ( '<STR_LIT>' , defaults , ** kwargs ) <EOL> if value is not None : <EOL> obj . set_dpi ( value ) </s>
