HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyc
�
[�3Lc@s�dZddlmZddlmZddlmZmZddlm	Z	ddl
mZmZddl
ZddlZdejfd	��YZd
ejfd��YZddlmZd
efd��YZdejfd��YZdefd��YZddlZiZd�ZddlmZddlmZeee��ZddljZ e j!e�Z"d�Z#d�Z$e%dkr�ddl&j'Z(e(j)ddd�Z*e*j+�e$e*�e(j,�ndS(s/
An experimental support for curvelinear grid.
i����(tchain(t
GridFinder(tAxisArtistHelpertGridHelperBase(t
AxisArtist(tAffine2DtIdentityTransformNtFloatingAxisArtistHelpercBseZRS((t__name__t
__module__(((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyRstFixedAxisArtistHelpercBsJeZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(cCst|j|�\}}tt|�j|||d|�|dkrL|}n||_||_||_||_dS(s}
        nth_coord = along which coordinate value varies.
         nth_coord = 0 ->  x axis, nth_coord = 1 -> y axis
        taxis_directionN(	tget_data_boundarytsuperR
t__init__tNonetnth_coord_tickstvaluetgrid_helpert_side(tselfRtsideRRt	nth_coord((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyRs				cCs#|jj|�|jj|_dS(N(Rt
update_limt	grid_info(Rtaxes((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR1scCs�|jd}|jdkra|j}|d|dd}dt|d|d�d}}nT|jdkr�|d|dd}|j}t|d|d�dd}}n|jj}|j|g|g�\}}	|j|jj	�}
|
j
|d|	dg�}d|dko-d	knr�d|dkoMd	knr�|jj
|d|	dg�\}}
|j||g||g�\}}|jj
|d|dg�\}}||
ftj||
||�tj
d
fSdSdS(Ntextremesiiig@gg@�@ig�?g�f@(NN(RRRtabsRtgrid_finderttransform_xyt	transDatat	transAxestinvertedttransform_pointtnptarctan2tpiR(RRRtxx0tyy0tdxxtdyyRtxx1tyy1ttrans_passingthrough_pointtptxx1ctyy1ctxx2tyy2txx2ctyy2c((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytget_axislabel_pos_angle8s&
	&	&@&&&/cCst�S(N(R(RR((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytget_tick_transformWsc
s��jj��jd\}}}�jd\}}}tj|�tj|�}}|dk	rz||}d|}	n|}d}	|dk	r�||}
d|}n|}
d}�jj}t|d �\}
}t|d�\}}�jdkr||k||k@}||}n2�jdkrQ|
|
k|
|k@}|
|}
n��fd�}�jdkr�tj	|�}
|
j
�j�||
|�\��	|
j�}||
||kc|8<|||�\��
||||�\��|j�}|||	|kc|	8<||
|�\��||
||	�\��
�jd�gt
�|�D]\}}|rk|^qk�n)�jdkr�tj	|
�}|j
�j�||
|�\��	|j�}|||	|kc|	8<||
|�\��
||
||	�\��|
j�}||
||kc|8<|||�\��||||�\��
�jd	�gt
�|�D]\}}|r�|^q��n���������	�
���
f
d
�}|�tg�fS(s9tick_loc, tick_angle, tick_label, (optionally) tick_labeltlat_infotlon_infog����MbP?iiics[�j||�\}}�jjtj||g�j��}|j�\}}||fS(N(RRt	transformR"tarrayt	transpose(txtytx1ty1tx2y2tx2ty2(RR(sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR|s't
lat_labelst
lon_labelsc
3satj�
�	���}tj�����}�
�	dk��dk@}||dd||<�j��}|�jj�}x�t��||��D]�\}}}}}	|j||f�}
d}d||
dko�d|knr�d||
dkod|knr�|dd}|dd}||g|||	fVq�q�WdS(	Nggn��!	@g@g�h㈵��>ig�?ig�f@(R"R#R4RR tzipR!(
tddtdd2tmmt
trans_tickttr2axR:R;tdtd2tlabtc2tdeltatd1(
RtlabelsRR)txx1atxx1btxx2atxx2bR*tyy1atyy1btyy2atyy2b(sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytf1�s.((N(RRRR"tasarrayRt	_extremestsortedRt
empty_liketfillRtcopyRCtiter(RRtlat_levstlat_nt
lat_factortlon_levstlon_nt
lon_factorR&tdyR%tdxRZtxmintxmaxtymintymaxtmaskRtxx00tyy00tltmRX((RRRORR)RPRQRRRSR*RTRURVRWsX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytget_tick_iteratorsZsl






1
13cCs|jS(N(R(RR((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytget_line_transform�sc
Csu|j|�ddlm}tdddddd
d
d�|j\}}|j||\}}|t||��S(Ni����(tPathtleftt
lon_lines0itrightitbottomt
lat_lines0ttop(Rui(Rui(Rxi(Rxi(Rtmatplotlib.pathRstdictRRRC(RRRstktvtxxtyy((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytget_line�s
N(
RR	RRRR3R4RqRrR�(((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR
s				n	(tExtremeFinderSimpletExtremeFinderFixedcBseZd�Zd�ZRS(cCs
||_dS(N(RZ(RR((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR�scCs|jS(s�
        get extreme values.

        x1, y1, x2, y2 in image coordinates (0-based)
        nx, ny : number of dvision in each axis
        (RZ(RRR<R=R?R@((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyt__call__�s(RR	RR�(((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR��s	tGridHelperCurveLinearcBsVeZddddd�Zd�Zddddd�Zd�Zd�Zd�ZRS(cCsSd|_||_t|�}tt|�j||d|d|d|d|�dS(s�
        aux_trans : a transform from the source (curved) coordinate to
        target (rectlinear) coordinate. An instance of MPL's Transform
        (inverse transform should be defined) or a tuple of two callable
        objects which defines the transform and its inverse. The callables
        need take two arguments of array of source coordinates and
        should return two target coordinates:
          e.g. x2, y2 = trans(x1, y1)
        t
grid_locator1t
grid_locator2ttick_formatter1ttick_formatter2N(Rt_old_valuesRZR�R
R�R(Rt	aux_transRR�R�R�R�textreme_finder((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR�s		c
CsP|j\}}}}td|dfd|dfd|dfd|df�|S(s%
        return v= 0 , nth=1
        RtiRvRwiRy(RZR{(RRtlon1tlon2tlat1tlat2((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR s
cCs�|dkr|j}n|dkr-|}nt||d|�}t||d|�}|jjt�|jj|jj�|S(NRR(	RRR
Rtlinetset_clip_ontTruetset_clip_boxtbbox(RtlocRRtoffsetRt_helpertaxisline((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytnew_fixed_axis+s		cCs7|jdkrt�|_n|j}|j}|j|j||||�}t|d �\}}	t|d�\}
}|j||	�\}}
}|j|
|�\}}}||	|
|f|d<||
|f|d<|||f|d<|j	d||�|d<|j
d||�|d<|dkr@tj||
 �}ntj||
 |�}|dkrytj|| �}ntj|| |�}|||k||	k@}||
|k||k@}|j
||||	|
|�\}}||d<||d	<|j
|d |d|�\}}||d
<||d<dS(NiRR6R5RwRBRAt	lon_linest	lat_linesRuRx(RRR{RR�tinv_transform_xyR[R�R�R�R�R"RYt_get_raw_grid_lines(RR<R=R?R@RRRtlon_mintlon_maxtlat_mintlat_maxRcRdReR`RaRbt
lon_valuest
lat_valuestlon_values0tlat_values0R�R�((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyt_update_gridYsL			
	
	



cCsZg}x%|jdD]}|j|g�qWx%|jdD]}|j|g�q<W|S(NR�R�(Rtextend(Rt
grid_linestgl((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyt
get_gridlines�scCsF|j\}}}}|j}tj||d�}tj|�tj|�}}|j|�|j|�tj||d�}	tj|	�tj|	�}
}|
j|�|j|�tj|d |d |ddd�|
g�}tj|d |	d |d |	ddd�g�}
|jtj||
g�j	��}|S(sD
        return Nx2 array of x,y coordinate of the boundary
        idi����iN(
RZt
_aux_transR"tlinspaceR\R]tconcatenateR7R8R9(Rtx0R<ty0R=ttrR~R&R*RR%R)txxxtyyytt((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytget_boundary�s	



04$N(	RR	RRRR�R�R�R�(((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR��s/	*	A	
tFloatingAxesBasecBs,eZd�Zd�Zd�Zd�ZRS(cOs||jdd�}|dkr-td��nt|d�sKtd��n|jj|||�|jd�|j�dS(NRs*FloatingAxes requires grid_helper argumentR�s.grid_helper must implement get_boundary methodg�?(tgetRt
ValueErrorthasattrt_axes_class_floatingRt
set_aspecttadjust_axes_lim(RtkltkwargsR((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR�s
cCs4ddlj}|j�}|j�}|j|�S(s[
        Returns the patch used to draw the background of the axes.  It
        is also used as the clipping path for any data elements on the
        axes.

        In the standard axes, this is a rectangle, but in other
        projections it may not be.

        .. note::
            Intended to be overridden by new projection types.
        i����N(tmatplotlib.patchestpatchestget_grid_helperR�tPolygon(RtmpatchesRR�((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyt_gen_axes_patch�scCs�|jj|�|jj|j�|jj|�}|j|j�|jt	�|j|j
�|jj|�|jj|�||_
dS(N(R�tclatpatcht
set_transformRR�t
set_figuretfiguretset_visibletFalseRt
set_clip_patht	gridlinest_original_patch(RR�((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR��s
cCs�|j�}|j�}|dd�df|dd�df}}t|�t|�}}t|�t|�}}||d}	||d}
|j||	||	�|j||
||
�dS(NiigY@(R�R�tmintmaxtset_xlimtset_ylim(RRR�R:R;RhRiRjRkRgRf((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR��s-(RR	RR�R�R�(((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyR��s	
		cCsUtj|�}|dkrQtjd|jt|fi|d6�}|t|<n|S(NsFloating %sR�(t_floatingaxes_classesR�RtnewtclassobjRR�(t
axes_classt	new_class((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytfloatingaxes_class_factory
s	
(tAxes(thost_axes_class_factorycCs�ddl}ddl}ddlm}t�j|jdd�|j�}|jd�}|j	�}ddl
m}|dd	d
ddg�}t|d
d.d|d|d|dd�}	t|dd|	�a|jt�d}
t�jdd|
�|}|dddg�}t|d
ddd|
d|
fd|�}|jddt�tjd<atjdjjd�tjdjjd �x(ddgD]}
tj|
jt�q�W|	jd!d"dtd#d$�tjd%<atjd&td't�tjjd(�tjjt�tjjd)�tj|�}d*dd+dgdd,dd	g}}|j||�|j||d-�\}|jtj �dS(/s5
    polar projection, but in a rectangular box.
    i����N(t	PolarAxesg�f@g�?i(tFixedLocatoriiiii
RiihiR�R�R�R�ioRg$@ii<iZg@RvRRtsTest 1sTest 2iiRRwtztalltlabelsz = ?s0.5iCiKisk-(iihi
i(!tnumpytangle_helpertmatplotlib.projectionsR�RtscaleR$tPolarTransformt
LocatorDMStFormatterDMSRR�R�RtFloatingSubplottax1tadd_subplotR�taxisR�tset_textR�R�tnew_floating_axisttoggleR�R�t	set_colortget_aux_axestscattertplotR�R�(tfigR"R�R�R�R�R�R�R�Rtr_scalettr2tgrid_helper2tantax2R~RRo((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytcurvelinear_test3*sP&		
		 %cCs%ddl}ddl}ddlm}t�j|jdd�|j�}|jd�}|j	�}ddl
m}|dd	d
ddg�}t|d
d*d|d|d|dd�}	t|dd|	�a|jt�tjdjjd�tjdjjd�x%dgD]}
tj|
jt�qW|	jdddtdd �tjd!<atjd"td#t�tjjd�tjjd$�tjjt�tjjd%�tj|�}d&d'd(dgdddd	g}}
|j||
�|j||
d)�\}|jtj �dS(+s5
    polar projection, but in a rectangular box.
    i����N(R�g�f@g�?i(R�iiiii
RixiiR�R�R�R�ioRRtsTest 1RvsTest 2RyiiFRRRwR�R�R�sz = ?s0.5iCiZiKsk-(ixii
i(!R�R�R�R�RR�R$R�R�R�RR�R�RR�R�R�R�R�R�R�R�R�R�R�tset_axis_directionR�R�R�R�R�R�R�(R�R"R�R�R�R�R�R�R�RR�R�R~RRo((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pytcurvelinear_test4�sB&		
%t__main__itfigsizei(ii(-t__doc__t	itertoolsRRRt	axislinesRRtaxis_artistRtmatplotlib.transformsRRR�R"tgrid_helper_curvelinearRR
R�R�R�tobjectR�R�R�R�R�t%mpl_toolkits.axes_grid1.parasite_axesR�tFloatingAxestmatplotlib.axesRtmaxestsubplot_class_factoryR�R�R�Rtmatplotlib.pyplottpyplottpltR�R�tclftshow(((sX/opt/alt/python27/lib64/python2.7/site-packages/mpl_toolkits/axisartist/floating_axes.pyt<module>s:��D		[	@