Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/matplotlib/__pycache__/gridspec.cpython-37.pyc

272 lines
18 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
U<>]<5D>Q<00>@s<>dZddlZddlZddlZddlZddlmZmZm Z m
Z
ddl m Z ddl mZe<02>e<11>ZGdd<06>de<13>ZGdd<08>de<14>ZGd d
<EFBFBD>d
e<14>ZGd d <0C>d <0C>ZdS) a`
:mod:`~matplotlib.gridspec` contains classes that help to layout multiple
`~axes.Axes` in a grid-like pattern within a figure.
The `GridSpec` specifies the overall grid structure. Individual cells within
the grid are referenced by `SubplotSpec`\s.
See the tutorial :ref:`sphx_glr_tutorials_intermediate_gridspec.py` for a
comprehensive usage guide.
<EFBFBD>N)<04>_pylab_helpers<72>cbook<6F> tight_layout<75>rcParams)<01>Bboxc@speZdZdZddd<04>Zdd<06>Zdd<08>Zdd d
<EFBFBD>Zdd d <0A>Zdd<0F>Z dd<11>Z
dd<13>Z dd<15>Z ddd<18>Z dd<1A>ZdS)<1F> GridSpecBasezm
A base class of GridSpec that specifies the geometry of the grid
that a subplot will be placed.
NcCs&|||_|_|<00>|<03>|<00>|<04>dS)z<>
The number of rows and number of columns of the grid need to
be set. Optionally, the ratio of heights and widths of rows and
columns can be specified.
N)<04>_nrows<77>_ncols<6C>set_height_ratios<6F>set_width_ratios)<05>self<6C>nrows<77>ncols<6C> height_ratios<6F> width_ratios<6F>r<00>;/tmp/pip-install-i8dhxrtk/matplotlib/matplotlib/gridspec.py<70>__init__s
zGridSpecBase.__init__cCsN|jdk rd|jnd}|jdk r,d|jnd}dj|jj|j|j||d<05>S)Nz, height_ratios=%r<>z, width_ratios=%rz&{clsname}({nrows}, {ncols}{optionals}))Zclsnamer r<00> optionals)<07>_row_height_ratios<6F>_col_width_ratios<6F>format<61> __class__<5F>__name__rr )r Z
height_argZ width_argrrr<00>__repr__)szGridSpecBase.__repr__cCs |j|jfS)zW
Return a tuple containing the number of rows and columns in the grid.
)rr )r rrr<00> get_geometry5szGridSpecBase.get_geometrycCsdS)Nr)r <00>figure<72>figrrr<00>get_subplot_params;szGridSpecBase.get_subplot_params<6D>cCs(|\}}||||<00>|||<00>f}|S)z,Create and return a `.SubplotSpec` instance.r)r <00>locZrowspanZcolspan<61>loc1<63>loc2Z subplotspecrrr<00>new_subplotspec>szGridSpecBase.new_subplotspeccCs(|dk rt|<01>|jkrtd<01><01>||_dS)NzTExpected the given number of width ratios to match the number of columns of the grid)<04>lenr <00>
ValueErrorr)r rrrrr DszGridSpecBase.set_width_ratioscCs|jS)N)r)r rrr<00>get_width_ratiosJszGridSpecBase.get_width_ratioscCs(|dk rt|<01>|jkrtd<01><01>||_dS)NzRExpected the given number of height ratios to match the number of rows of the grid)r%rr&r)r rrrrr
MszGridSpecBase.set_height_ratioscCs|jS)N)r)r rrr<00>get_height_ratiosSszGridSpecBase.get_height_ratiosFcs<>|<00><00>\}}|r*d}d}d}d}d} d}
n.|<00>|<01>} | j}| j}| j}| j}| j} | j}
||} ||} | ||
|d}|
|}|jdk r<>||t |j<08><00><00>fdd<06>|jD<00>}n
|g|}dg|g|d}t
<EFBFBD> t
<EFBFBD> ||g<02>j <0A>}| || |d}| |}|jdk <09>r:||t |j<0E><00><00>fdd<06>|jD<00>}n
|g|}dg|g|d}t
<EFBFBD> t
<EFBFBD> ||g<02>j <0A>}||<00>d <09>j\}}||<00>d <09>j\}}||||fS)
z<EFBFBD>
Return lists of bottom and top position of rows, left and
right positions of columns.
If raw=True, then these are all in units relative to the container
with no margins. (used for constrained_layout).
gg<00>?r Ncsg|] }|<01><00>qSrr)<02>.0<EFBFBD>r)<01>normrr<00>
<listcomp>wsz3GridSpecBase.get_grid_positions.<locals>.<listcomp>rcsg|] }|<01><00>qSrr)r)r*)r+rrr,<00>s)<02><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)rr<00>left<66>right<68>bottom<6F>top<6F>wspace<63>hspacer<00>sum<75>npZcumsumZ column_stackZflatrZreshape<70>T)r r<00>rawr rr/r0r1r2r3r4Zsubplot_paramsZ tot_widthZ
tot_heightZcell_hZsep_hZ cell_heightsZ sep_heightsZcell_hsZcell_wZsep_wZ cell_widthsZ
sep_widthsZcell_ws<77>fig_tops<70> fig_bottoms<6D> fig_lefts<74>
fig_rightsr)r+r<00>get_grid_positionsVsH 


 
zGridSpecBase.get_grid_positionsc Cs<>|<00><00>\}}dd<02>}t|t<02>rry |\}}Wntk
rFtd<03><01>YnXt<04>|||d<04>|||d<05>g||f<02>\}}n||||d<06>\}}t|||<08>S)z,Create and return a `.SubplotSpec` instance.cSs<>|}t|t<01>r<|<00>|<01>\}}}||kr2||dfStd<02><01>nh|dkrL||}d|kr`|krlnn||fS|dk r<>td|<03>d|<02>d|<01><00><06><01>ntd|<03>d|<01><00><04><01>dS)Nr z=GridSpec slice would result in no space allocated for subplotrzindex z is out of bounds for axis z with size z) is out of bounds for GridSpec with size )<04>
isinstance<EFBFBD>slice<63>indices<65>
IndexError)<07>key<65>sizeZaxisZorig_key<65>start<72>stop<6F>_rrr<00>
_normalize<EFBFBD>s
 
z,GridSpecBase.__getitem__.<locals>._normalizezunrecognized subplot specrr N)rr><00>tupler&r6Zravel_multi_index<65> SubplotSpec) r rBr rrGZk1Zk2<6B>num1<6D>num2rrr<00> __getitem__<5F>s 
 zGridSpecBase.__getitem__)NN)NN)r r )F)r<00>
__module__<EFBFBD> __qualname__<5F>__doc__rrrrr$r r'r
r(r=rLrrrrrs
 


6rc @s^eZdZdZddd<04>Zddddd d
gZd d <0C>Zd d<0E>Zdd<10>Zddd<12>Z dd<14>Z
ddd<17>Z dS)<1B>GridSpecz<63>
Specifies the geometry of the grid that a subplot can be placed in.
The location of grid is determined by similar way as the SubplotParams.
Nc Cs<>||_||_||_||_||_| |_||_tj||||
| d<01>|jdksR|j<06> <09>sZd|_
n(|j<06> <0B>t j |jj
dt <0C><0E>|d<04>|_
dS)a<>
The number of rows and number of columns of the grid need to be set.
Optionally, the subplot layout parameters (e.g., left, right, etc.)
can be tuned.
Parameters
----------
nrows : int
Number of rows in grid.
ncols : int
Number or columns in grid.
figure : `~.figure.Figure`, optional
left, right, top, bottom : float, optional
Extent of the subplots as a fraction of figure width or height.
Left cannot be larger than right, and bottom cannot be larger than
top.
wspace : float, optional
The amount of width reserved for space between subplots,
expressed as a fraction of the average axis width.
hspace : float, optional
The amount of height reserved for space between subplots,
expressed as a fraction of the average axis height.
width_ratios : length *ncols* iterable, optional
Width ratios of the columns.
height_ratios : length *nrows* iterable, optional
Height ratios of the rows.
Notes
-----
See `~.figure.SubplotParams` for descriptions of the layout parameters.
)rrN<>gridspec)<03>parent<6E>name<6D>artist)r/r1r0r2r3r4rrrZget_constrained_layout<75>
_layoutboxZinit_layoutbox<6F> layoutbox<6F> LayoutBox<6F>seq_id) r r rrr/r1r0r2r3r4rrrrrr<00>s"*


zGridSpec.__init__r/r1r0r2r3r4cCs.|j}y|<01>d<01>Wntk
r(YnX|S)NrU)<03>__dict__<5F>pop<6F>KeyError)r <00>staterrr<00> __getstate__<5F>s zGridSpec.__getstate__cCs||_d|_dS)N)rYrU)r r\rrr<00> __setstate__szGridSpec.__setstate__cKsx:|<01><00>D].\}}||jkr*t|||<03>q
t|<02>d<01><02><01>q
Wx<>tjj<06><07>D]<5D>}x<>|jj j
D]<5D>}t |t j
j <0A>s<>t |jt j
j <0A>r<>|j<0E><0F><00><10>|kr<>|j<0E><11>|<05>|jj<13>n:t |jt j
j <0A>r<>|j<14><0F><00><10>|kr<>|j<14><11>|<05>|jj<13>qZ|<05><0F><00><15>}|<06><10>|krZ|<05><11>|<05>|j<13>qZWqJWdS)z`
Update the current values.
Values set to None use the rcParams value.
z is an unknown keywordN)<16>items<6D> _AllowedKeys<79>setattr<74>AttributeErrorrZGcfZfigs<67>valuesZcanvasr<00>axesr><00>mplZ SubplotBaseZ_sharexZget_subplotspec<65> get_gridspecZ update_paramsZ _set_position<6F>figboxZ_sharey<65>get_topmost_subplotspec)r <00>kwargs<67>k<>vZ
figmanagerZax<61>ssrrr<00>update s&


  zGridSpec.updatecsT|dkr(dd<03><00>jD<00>}tjjf|<02>}n t<04>|j<05>}|jf<00>fdd<03><08>jD<00><01>|S)z<>
Return a dictionary of subplot layout parameters. The default
parameters are from rcParams unless a figure attribute is set.
NcSsi|]}td||<01>qS)zfigure.subplot.)r)r)rjrrr<00>
<dictcomp>-sz/GridSpec.get_subplot_params.<locals>.<dictcomp>csi|]}t<00>|<01>|<01>qSr)<01>getattr)r)rj)r rrrn2s)r`rer<00> SubplotParams<6D>copy<70> subplotparsrm)r r<00>kwrrr)r rr's  zGridSpec.get_subplot_paramscs<00>fdd<02><08>jD<00>S)Ncsg|]}t<00>|<01>r|<01>qSr)ro)r)rj)r rrr,7sz<GridSpec.locally_modified_subplot_params.<locals>.<listcomp>)r`)r r)r r<00>locally_modified_subplot_params6sz(GridSpec.locally_modified_subplot_params<6D>H<EFBFBD>z<14>G<EFBFBD>?c
Csdtj|j|d<01>}d|kr"t<03>d<03>|dkr4t<00>|<01>}tj||j||||||d<04>}|r`|jf|<08>dS)ap
Adjust subplot parameters to give specified padding.
Parameters
----------
pad : float
Padding between the figure edge and the edges of subplots, as a
fraction of the font-size.
h_pad, w_pad : float, optional
Padding (height/width) between edges of adjacent subplots.
Defaults to *pad*.
rect : tuple of 4 floats, optional
(left, bottom, right, top) rectangle in normalized figure
coordinates that the whole subplots area (including labels) will
fit into. Default is (0, 0, 1, 1).
)Z grid_specNzcThis figure includes Axes that are not compatible with tight_layout, so results might be incorrect.)<04>pad<61>h_pad<61>w_pad<61>rect)rZget_subplotspec_listrdrZ_warn_externalZ get_rendererZget_tight_layout_figurerm) r rZrendererrvrwrxryZsubplotspec_listrirrrr9s 


zGridSpec.tight_layout) NNNNNNNNN)N)NruNNN) rrMrNrOrr`r]r^rmrrtrrrrrrP<00>s
?
rPc@s,eZdZdZd dd<04>Zd
dd<06>Zdd<08>ZdS) <0B>GridSpecFromSubplotSpeczx
GridSpec whose subplot layout parameters are inherited from the
location specified by a given SubplotSpec.
Nc Cs`||_||_||_tj|||||d<01>|j}|dkr<d|_n |j||jdt<08> <09>|d<04>|_dS)a`
The number of rows and number of columns of the grid need to
be set. An instance of SubplotSpec is also needed to be set
from which the layout parameters will be inherited. The wspace
and hspace of the layout can be optionally specified or the
default values (from the figure or rcParams) will be used.
)rrNz .gridspec)rSrT)
<EFBFBD>_wspace<63>_hspace<63> _subplot_specrrrUZlayout_from_subplotspecrSrVrX) r r rZ subplot_specr3r4rrZ subspeclbrrrrcs 
z GridSpecFromSubplotSpec.__init__c Cs<>|jdk r|jn|dk r |jjntd}|jdk r8|jn|dk rH|jjntd}|j<06>|<01>}|j\}}}}t j
j ||||||d<04>S)z:Return a dictionary of subplot layout parameters.
Nzfigure.subplot.hspacezfigure.subplot.wspace)r/r0r1r2r3r4) r|rrr4rr{r3r}<00> get_positionZextentsrerrp) r rr4r3rgr/r1r0r2rrrrs 
z*GridSpecFromSubplotSpec.get_subplot_paramscCs
|j<00><01>S)zY
Return the topmost `.SubplotSpec` instance associated with the subplot.
)r}rh)r rrrrh<00>sz/GridSpecFromSubplotSpec.get_topmost_subplotspec)NNNN)N)rrMrNrOrrrhrrrrrz^s


rzc@sleZdZdZddd<04>Zdd<06>Zdd<08>Zd d
<EFBFBD>Zd d <0C>Zd d<0E>Z ddd<11>Z
dd<13>Z dd<15>Z dd<17>Z dd<19>ZdS)rIaL
Specifies the location of a subplot in a `GridSpec`.
.. note::
Likely, you'll never instantiate a `SubplotSpec` yourself. Instead you
will typically obtain one from a `GridSpec` using item-access.
Parameters
----------
gridspec : `~matplotlib.gridspec.GridSpec`
The GridSpec, which the subplot is referencing.
num1, num2 : int
The subplot will occupy the num1-th cell of the given
gridspec. If num2 is provided, the subplot will span between
num1-th cell and num2-th cell.
The index starts from 0.
NcCsN||_||_||_|jdk rD|j}tj||jdt<04><07>|d<02>|_nd|_dS)Nz.ss)rRrSrT)<08> _gridspecrJrKrUrVrWrSrX)r rQrJrKZglbrrrr<00>s
 zSubplotSpec.__init__cCs.|j}y|<01>d<01>Wntk
r(YnX|S)NrU)rYrZr[)r r\rrrr]<00>s zSubplotSpec.__getstate__cCs||_d|_dS)N)rYrU)r r\rrrr^<00>szSubplotSpec.__setstate__cCs|jS)N)r)r rrrrf<00>szSubplotSpec.get_gridspeccCs |<00><00><00><01>\}}|||j|jfS)a
Return the subplot geometry as tuple ``(n_rows, n_cols, start, stop)``.
The indices *start* and *stop* define the range of the subplot within
the `GridSpec`. *stop* is inclusive (i.e. for a single cell
``start == stop``).
)rfrrJrK)r <00>rows<77>colsrrrr<00>szSubplotSpec.get_geometrycCsX|<00><00>}|<01><01>\}}t|j|<03>\}}|jdk r@t|j|<03>\}}n|}|}||||||fS)z<>
Return the subplot row and column numbers as a tuple
``(n_rows, n_cols, row_start, row_stop, col_start, col_stop)``.
N)rfr<00>divmodrJrK)r rQr rZ row_startZ col_startZrow_stopZcol_stoprrr<00>get_rows_columns<6E>s 
zSubplotSpec.get_rows_columnsFcCs<>|<00><00>}|<03><01>\}}t<02>|jdkr*|jgn
|j|jg||f<02>\}}|<03>|<01>\}} }
} ||<00><07>} | |<00><08>} |
|<00><07>}| |<00><08>}t <09>
|| || <0A>}|r<>||d|d||fS|SdS)zJ
Update the subplot position from ``figure.subplotpars``.
Nr) rfrr6Z unravel_indexrKrJr=<00>min<69>maxrZ from_extents)r rZ
return_allrQr rr<>r<>r:r9r;r<Z
fig_bottomZfig_topZfig_leftZ fig_rightrgrrrr~<00>s     zSubplotSpec.get_positioncCs"|<00><00>}t|d<01>r|<01><02>S|SdS)zX
Return the topmost `SubplotSpec` instance associated with the subplot.
rhN)rf<00>hasattrrh)r rQrrrrh<00>s
z#SubplotSpec.get_topmost_subplotspeccCs8|j|j|jft|dt<04><00>t|dt<04><00>t|dt<04><00>fkS)z}
Two SubplotSpecs are considered equal if they refer to the same
position(s) in the same `GridSpec`.
rrJrK)rrJrKro<00>object)r <00>otherrrr<00>__eq__s  zSubplotSpec.__eq__cCst|j|j|jf<03>S)N)<04>hashrrJrK)r rrr<00>__hash__szSubplotSpec.__hash__cKst|||f|<03>S)a<>
Create a GridSpec within this subplot.
The created `.GridSpecFromSubplotSpec` will have this `SubplotSpec` as
a parent.
Parameters
----------
nrows : int
Number of rows in grid.
ncols : int
Number or columns in grid.
Returns
-------
gridspec : `.GridSpecFromSubplotSpec`
Other Parameters
----------------
**kwargs
All other parameters are passed to `.GridSpecFromSubplotSpec`.
See Also
--------
matplotlib.pyplot.subplots
Examples
--------
Adding three subplots in the space occupied by a single subplot::
fig = plt.figure()
gs0 = fig.add_gridspec(3, 1)
ax1 = fig.add_subplot(gs0[0])
ax2 = fig.add_subplot(gs0[1])
gssub = gs0[2].subgridspec(1, 3)
for i in range(3):
fig.add_subplot(gssub[0, i])
)rz)r r rrirrr<00> subgridspecs(zSubplotSpec.subgridspec)N)F)rrMrNrOrr]r^rfrr<>r~rhr<>r<>r<>rrrrrI<00>s
 

 rI)rOrq<00>loggingZnumpyr6Z
matplotlibrerrrrZmatplotlib.transformsrZmatplotlib._layoutboxrUrV<00> getLoggerr<00>_logr<67>rrPrzrIrrrr<00><module>
s  
-9