Revision: 7292
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7292&view=rev
Author: leejjoon
Date: 2009-07-23 22:23:04 +0000 (Thu, 23 Jul 2009)
Log Message:
-----------
axes_grid: tick_out support for axisline.AxisArtist
Modified Paths:
--------------
trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py
Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py 2009-07-23
21:59:15 UTC (rev 7291)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py 2009-07-23
22:23:04 UTC (rev 7292)
@@ -650,10 +650,16 @@
from matplotlib.lines import Line2D
class Ticks(Line2D):
- def __init__(self, ticksize, **kwargs):
+ def __init__(self, ticksize, tick_out=False, **kwargs):
+ """
+ ticksize : ticksize
+ tick_out : tick is directed outside (rotated by 180 degree) if True.
default is False.
+ """
self.ticksize = ticksize
self.locs_angles = []
+ self.set_tick_out(tick_out)
+
self._axis = kwargs.pop("axis", None)
if self._axis is not None:
if "color" not in kwargs:
@@ -664,7 +670,18 @@
super(Ticks, self).__init__([0.], [0.], **kwargs)
self.set_snap(True)
+ def set_tick_out(self, b):
+ """
+ set True if tick need to be rotated by 180 degree.
+ """
+ self._tick_out = b
+ def get_tick_out(self):
+ """
+ Return True if the tick will be rotated by 180 degree.
+ """
+ return self._tick_out
+
def get_color(self):
if self._color == 'auto':
if self._axis is not None:
@@ -735,8 +752,11 @@
offset = renderer.points_to_pixels(size)
marker_scale = Affine2D().scale(offset, offset)
+ tick_out = self.get_tick_out()
for loc, angle, _ in self.locs_angles_labels:
+ if tick_out:
+ angle += 180
marker_rotation = Affine2D().rotate_deg(angle)
#marker_rotation.clear().rotate_deg(angle)
marker_transform = marker_scale + marker_rotation
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins