def _set_lim_and_transforms(self): """ This is called once when the plot is created to set up all the transforms for the data, text and grids. """ rot = 30 # Get the standard transform setup from the Axes base class Axes._set_lim_and_transforms(self) # Need to put the skew in the middle, after the scale and limits, # but before the transAxes. This way, the skew is done in Axes # coordinates thus performing the transform around the proper origin # We keep the pre-transAxes transform around for other users, like the # spines for finding bounds self.transDataToAxes = self.transScale + \ self.transLimits + transforms.Affine2D().skew_deg(rot, 0) # Create the full transform from Data to Pixels self.transData = self.transDataToAxes + self.transAxes # Blended transforms like this need to have the skewing applied using # both axes, in axes coords like before. self._xaxis_transform = (transforms.blended_transform_factory( self.transScale + self.transLimits, transforms.IdentityTransform()) + transforms.Affine2D().skew_deg(rot, 0)) + self.transAxes
def _set_lim_add_transforms(self): rot = 30 Axes._set_lim_and_transforms(self) self.transDataToAxes = self.transScale + \ self.transLimits + transforms.Affine2D().skew_deg(rot, 0) self.transData = self.transDataToAxes + self.transAxes self._xaxis_transform = (transforms.blended_transform_factory( self.transScale + self.transLimits, transforms.IdentityTransform() ) + transforms.Affine2D().skew_deg(rot, 0)) + self.transAxes
def _set_lim_and_transforms(self): """ This is called once when the plot is created to set up all the transforms for the data, text and grids. """ #Get the standard transform setup from the Axes base class Axes._set_lim_and_transforms(self) #Save the unskewed data transform for our own use when regenerating #the data transform. The user might want this as well self._transDataNonskew = self.transData #Create a wrapper for the data transform, so that any object that #grabs this transform will see an updated version when we change it self.transData = transforms.TransformWrapper( transforms.IdentityTransform()) #Create a wrapper for the proj. transform, so that any object that #grabs this transform will see an updated version when we change it self.transProjection = transforms.TransformWrapper( transforms.IdentityTransform()) self._update_data_transform()