44from __future__ import division
55import math
66
7- import numpy as npy
7+ import numpy as np
88
99from matplotlib import cbook
1010from matplotlib import rcParams
@@ -180,8 +180,8 @@ def _get_layout(self, renderer):
180180 width , height = 0.0 , 0.0
181181 lines = self ._text .split ('\n ' )
182182
183- whs = npy .zeros ((len (lines ), 2 ))
184- horizLayout = npy .zeros ((len (lines ), 4 ))
183+ whs = np .zeros ((len (lines ), 2 ))
184+ horizLayout = np .zeros ((len (lines ), 4 ))
185185
186186 # Find full vertical extent of font,
187187 # including ascenders and descenders:
@@ -208,7 +208,7 @@ def _get_layout(self, renderer):
208208 # get the rotation matrix
209209 M = Affine2D ().rotate_deg (self .get_rotation ())
210210
211- offsetLayout = npy .zeros ((len (lines ), 2 ))
211+ offsetLayout = np .zeros ((len (lines ), 2 ))
212212 offsetLayout [:] = horizLayout [:, 0 :2 ]
213213 # now offset the individual text lines within the box
214214 if len (lines )> 1 : # do the multiline aligment
@@ -219,9 +219,9 @@ def _get_layout(self, renderer):
219219 offsetLayout [:, 0 ] += width - horizLayout [:, 2 ]
220220
221221 # the corners of the unrotated bounding box
222- cornersHoriz = npy .array (
222+ cornersHoriz = np .array (
223223 [(xmin , ymin ), (xmin , ymax ), (xmax , ymax ), (xmax , ymin )],
224- npy .float_ )
224+ np .float_ )
225225 # now rotate the bbox
226226 cornersRotated = M .transform (cornersHoriz )
227227
@@ -658,7 +658,7 @@ class TextWithDash(Text):
658658 dashlength is the length of the dash in canvas units.
659659 (default=0.0).
660660
661- dashdirection is one of 0 or 1, npy .where 0 draws the dash
661+ dashdirection is one of 0 or 1, np .where 0 draws the dash
662662 after the text and 1 before.
663663 (default=0).
664664
@@ -782,15 +782,15 @@ def update_coords(self, renderer):
782782 dashpush = self .get_dashpush ()
783783
784784 angle = get_rotation (dashrotation )
785- theta = npy .pi * (angle / 180.0 + dashdirection - 1 )
786- cos_theta , sin_theta = npy .cos (theta ), npy .sin (theta )
785+ theta = np .pi * (angle / 180.0 + dashdirection - 1 )
786+ cos_theta , sin_theta = np .cos (theta ), np .sin (theta )
787787
788788 transform = self .get_transform ()
789789
790790 # Compute the dash end points
791791 # The 'c' prefix is for canvas coordinates
792792 cxy = transform .transform_point ((dashx , dashy ))
793- cd = npy .array ([cos_theta , sin_theta ])
793+ cd = np .array ([cos_theta , sin_theta ])
794794 c1 = cxy + dashpush * cd
795795 c2 = cxy + (dashpush + dashlength )* cd
796796
@@ -829,8 +829,8 @@ def update_coords(self, renderer):
829829 if dy > h or dy < - h :
830830 dy = h
831831 dx = h / tan_theta
832- cwd = npy .array ([dx , dy ])/ 2
833- cwd *= 1 + dashpad / npy .sqrt (npy .dot (cwd ,cwd ))
832+ cwd = np .array ([dx , dy ])/ 2
833+ cwd *= 1 + dashpad / np .sqrt (np .dot (cwd ,cwd ))
834834 cw = c2 + (dashdirection * 2 - 1 )* cwd
835835
836836 newx , newy = inverse .transform_point (tuple (cw ))
@@ -840,7 +840,7 @@ def update_coords(self, renderer):
840840 # I'm not at all sure this is the right way to do this.
841841 we = Text .get_window_extent (self , renderer = renderer )
842842 self ._twd_window_extent = we .frozen ()
843- self ._twd_window_extent .update_from_data_xy (npy .array ([c1 ]), False )
843+ self ._twd_window_extent .update_from_data_xy (np .array ([c1 ]), False )
844844
845845 # Finally, make text align center
846846 Text .set_horizontalalignment (self , 'center' )
@@ -1094,8 +1094,8 @@ def _get_xy(self, x, y, s):
10941094 return x , y
10951095 elif s == 'polar' :
10961096 theta , r = x , y
1097- x = r * npy .cos (theta )
1098- y = r * npy . sin (theta )
1097+ x = r * np .cos (theta )
1098+ y = r * np . cosmsin (theta )
10991099 trans = self .axes .transData
11001100 return trans .transform_point ((x ,y ))
11011101 elif s == 'figure points' :
0 commit comments