You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
(2) |
2
(5) |
3
(7) |
4
(1) |
5
(2) |
6
|
7
|
8
(2) |
9
(4) |
10
(1) |
11
|
12
(2) |
13
(3) |
14
|
15
(2) |
16
(2) |
17
|
18
|
19
(3) |
20
(5) |
21
(5) |
22
(1) |
23
(2) |
24
(1) |
25
(1) |
26
|
27
|
28
|
29
|
30
|
31
|
|
|
|
Revision: 8170 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8170&view=rev Author: jdh2358 Date: 2010年03月02日 13:12:16 +0000 (2010年3月02日) Log Message: ----------- fixed invalidx bug in Line2D get_xydata Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/lines.py Modified: trunk/matplotlib/lib/matplotlib/lines.py =================================================================== --- trunk/matplotlib/lib/matplotlib/lines.py 2010年03月02日 02:42:58 UTC (rev 8169) +++ trunk/matplotlib/lib/matplotlib/lines.py 2010年03月02日 13:12:16 UTC (rev 8170) @@ -659,7 +659,7 @@ """ Return the *xy* data as a Nx2 numpy array. """ - if self._invalidy or self.invalidx: + if self._invalidy or self._invalidx: self.recache() return self._xy @@ -831,7 +831,7 @@ def set_markerfacecolor(self, fc): """ - Set the marker face color. + Set the marker face color. ACCEPTS: any matplotlib color """ @@ -842,7 +842,7 @@ def set_markerfacecoloralt(self, fc): """ - Set the alternate marker face color. + Set the alternate marker face color. ACCEPTS: any matplotlib color """ @@ -1020,7 +1020,7 @@ path, path_trans, rgbFace) transform = transform.rotate_deg(180.) renderer.draw_markers(gc, righthalf, transform, - path, path_trans, rgbFace_alt) + path, path_trans, rgbFace_alt) _draw_pixel_transform = Affine2D().translate(-0.5, -0.5) @@ -1041,7 +1041,7 @@ rgbFace = self._get_rgb_face() fs = self.get_fillstyle() if fs=='full': - renderer.draw_markers(gc, Path.unit_circle(), transform, + renderer.draw_markers(gc, Path.unit_circle(), transform, path, path_trans, rgbFace) else: rgbFace_alt = self._get_rgb_face(alt=True) @@ -1118,8 +1118,8 @@ path, path_trans, rgbFace) renderer.draw_markers(gc, mpath_alt, transform, path, path_trans, rgbFace_alt) - + def _draw_triangle_up(self, renderer, gc, path, path_trans): self._draw_triangle(renderer, gc, path, path_trans, 'up') @@ -1190,8 +1190,8 @@ path, path_trans, rgbFace) renderer.draw_markers(gc, left, transform, path, path_trans, rgbFace_alt) - + def _draw_thin_diamond(self, renderer, gc, path, path_trans): gc.set_snap(renderer.points_to_pixels(self._markersize) >= 3.0) offset = renderer.points_to_pixels(self._markersize) @@ -1238,7 +1238,7 @@ path, path_trans, rgbFace) else: verts = polypath.vertices - + y = (1+np.sqrt(5))/4. top = Path([verts[0], verts[1], verts[4], verts[0]]) bottom = Path([verts[1], verts[2], verts[3], verts[4], verts[1]]) @@ -1299,7 +1299,7 @@ def _draw_hexagon1(self, renderer, gc, path, path_trans): - gc.set_snap(renderer.points_to_pixels(self._markersize) >= 5.0) + gc.set_snap(renderer.points_to_pixels(self._markersize) >= 5.0) offset = 0.5 * renderer.points_to_pixels(self._markersize) transform = Affine2D().scale(offset) @@ -1338,7 +1338,7 @@ def _draw_hexagon2(self, renderer, gc, path, path_trans): - gc.set_snap(renderer.points_to_pixels(self._markersize) >= 5.0) + gc.set_snap(renderer.points_to_pixels(self._markersize) >= 5.0) offset = 0.5 * renderer.points_to_pixels(self._markersize) transform = Affine2D().scale(offset).rotate_deg(30) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8169 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8169&view=rev Author: leejjoon Date: 2010年03月02日 02:42:58 +0000 (2010年3月02日) Log Message: ----------- add doc/mpl_toolkits/axes_grid/figures/simple_axis_pad.py and deleted unsed simple_axis_direction02.py Added Paths: ----------- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_pad.py Removed Paths: ------------- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction02.py Deleted: trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction02.py =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction02.py 2010年03月02日 02:24:34 UTC (rev 8168) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction02.py 2010年03月02日 02:42:58 UTC (rev 8169) @@ -1,21 +0,0 @@ - -import matplotlib.pyplot as plt -import mpl_toolkits.axes_grid.axislines as axislines - -def setup_axes(fig, rect): - ax = axislines.Subplot(fig, rect) - fig.add_subplot(ax) - - ax.set_yticks([0.2, 0.8]) - ax.set_xticks([0.2, 0.8]) - - return ax - -fig = plt.figure(1, figsize=(4, 2)) -ax = setup_axes(fig, "111") - -ax.axis[:].major_ticks.set_tick_out(True) - -plt.show() - - Added: trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_pad.py =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_pad.py (rev 0) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_pad.py 2010年03月02日 02:42:58 UTC (rev 8169) @@ -0,0 +1,112 @@ + + +import numpy as np +import mpl_toolkits.axes_grid.angle_helper as angle_helper +import mpl_toolkits.axes_grid.grid_finder as grid_finder +from matplotlib.projections import PolarAxes +from matplotlib.transforms import Affine2D + +import mpl_toolkits.axes_grid.axislines as axislines + +from mpl_toolkits.axes_grid.grid_helper_curvelinear import GridHelperCurveLinear + + +def setup_axes(fig, rect): + """ + polar projection, but in a rectangular box. + """ + + # see demo_curvelinear_grid.py for details + tr = Affine2D().scale(np.pi/180., 1.) + PolarAxes.PolarTransform() + + extreme_finder = angle_helper.ExtremeFinderCycle(20, 20, + lon_cycle = 360, + lat_cycle = None, + lon_minmax = None, + lat_minmax = (0, np.inf), + ) + + grid_locator1 = angle_helper.LocatorDMS(12) + grid_locator2 = grid_finder.MaxNLocator(5) + + tick_formatter1 = angle_helper.FormatterDMS() + + grid_helper = GridHelperCurveLinear(tr, + extreme_finder=extreme_finder, + grid_locator1=grid_locator1, + grid_locator2=grid_locator2, + tick_formatter1=tick_formatter1 + ) + + + ax1 = axislines.Subplot(fig, rect, grid_helper=grid_helper) + #ax1.axis[:].toggle(all=False) + ax1.axis[:].set_visible(False) + + fig.add_subplot(ax1) + + ax1.set_aspect(1.) + ax1.set_xlim(-5, 12) + ax1.set_ylim(-5, 10) + + #ax1.grid(True) + + return ax1 + + +def add_floating_axis1(ax1): + ax1.axis["lat"] = axis = ax1.new_floating_axis(0, 30) + axis.label.set_text(r"$\theta = 30^{\circ}$") + axis.label.set_visible(True) + + return axis + + +def add_floating_axis2(ax1): + ax1.axis["lon"] = axis = ax1.new_floating_axis(1, 6) + axis.label.set_text(r"$r = 6$") + axis.label.set_visible(True) + + return axis + + +import matplotlib.pyplot as plt +fig = plt.figure(1, figsize=(9, 3.)) +fig.clf() +fig.subplots_adjust(left=0.01, right=0.99, bottom=0.01, top=0.99, + wspace=0.01, hspace=0.01) + + +def ann(ax1, d): + if plt.rcParams["text.usetex"]: + d = d.replace("_", r"\_") + + ax1.annotate(d, (0.5, 1), (5, -5), + xycoords="axes fraction", textcoords="offset points", + va="top", ha="center") + +ax1 = setup_axes(fig, rect=141) +axis = add_floating_axis1(ax1) +ann(ax1, r"default") + +ax1 = setup_axes(fig, rect=142) +axis = add_floating_axis1(ax1) +axis.major_ticklabels.set_pad(10) +ann(ax1, r"ticklabels.set_pad(10)") + +ax1 = setup_axes(fig, rect=143) +axis = add_floating_axis1(ax1) +axis.label.set_pad(20) +ann(ax1, r"label.set_pad(20)") + +ax1 = setup_axes(fig, rect=144) +axis = add_floating_axis1(ax1) +axis.major_ticks.set_tick_out(True) +ann(ax1, "ticks.set_tick_out(True)") + + +#ax1.axis["bottom"].toggle(all=True) + +plt.show() + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8168 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8168&view=rev Author: jdh2358 Date: 2010年03月02日 02:24:34 +0000 (2010年3月02日) Log Message: ----------- fix alt kwarg for set_mfc Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/lines.py Modified: trunk/matplotlib/lib/matplotlib/lines.py =================================================================== --- trunk/matplotlib/lib/matplotlib/lines.py 2010年03月02日 01:47:54 UTC (rev 8167) +++ trunk/matplotlib/lib/matplotlib/lines.py 2010年03月02日 02:24:34 UTC (rev 8168) @@ -1586,7 +1586,7 @@ def set_mfc(self, val): 'alias for set_markerfacecolor' - self.set_markerfacecolor(val, alt=alt) + self.set_markerfacecolor(val) def set_mfcalt(self, val): 'alias for set_markerfacecoloralt' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8167 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8167&view=rev Author: leejjoon Date: 2010年03月02日 01:47:54 +0000 (2010年3月02日) Log Message: ----------- add AxisArtist.invert_ticklabel_direction and fix axis label padding in axes_grid Modified Paths: -------------- trunk/matplotlib/lib/mpl_toolkits/axes_grid/axis_artist.py trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/axis_artist.py =================================================================== --- trunk/matplotlib/lib/mpl_toolkits/axes_grid/axis_artist.py 2010年03月02日 01:47:48 UTC (rev 8166) +++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/axis_artist.py 2010年03月02日 01:47:54 UTC (rev 8167) @@ -389,6 +389,13 @@ def _get_offset_radius(self): return self._offset_radius + + _get_opposite_direction = {"left":"right", + "right":"left", + "top":"bottom", + "bottom":"top"}.__getitem__ + + def _update(self, renderer): pass @@ -665,6 +672,11 @@ self.set_default_alignment(label_direction) self.set_default_angle(label_direction) + + def invert_axis_direction(self): + label_direction = self._get_opposite_direction(self._axis_direction) + self.set_axis_direction(label_direction) + def _get_ticklabels_offsets(self, renderer, label_direction): """ Calculates the offsets of the ticklabels from the tick and @@ -1021,6 +1033,15 @@ else: self._ticklabel_add_angle = 0 + def invert_ticklabel_direction(self): + self._ticklabel_add_angle = (self._ticklabel_add_angle + 180) % 360 + self.major_ticklabels.invert_axis_direction() + self.minor_ticklabels.invert_axis_direction() + + # def invert_ticks_direction(self): + # self.major_ticks.set_tick_out(not self.major_ticks.get_tick_out()) + # self.minor_ticks.set_tick_out(not self.minor_ticks.get_tick_out()) + def set_axislabel_direction(self, label_direction): """ Adjust the direction of the axislabel. @@ -1190,9 +1211,10 @@ # set extra pad for major and minor ticklabels: # use ticksize of majorticks even for minor ticks. not clear what is best. + dpi_cor = renderer.points_to_pixels(1.) if self.major_ticks.get_visible() and self.major_ticks.get_tick_out(): - self.major_ticklabels._set_external_pad(self.major_ticks._ticksize) - self.minor_ticklabels._set_external_pad(self.major_ticks._ticksize) + self.major_ticklabels._set_external_pad(self.major_ticks._ticksize*dpi_cor) + self.minor_ticklabels._set_external_pad(self.major_ticks._ticksize*dpi_cor) else: self.major_ticklabels._set_external_pad(0) self.minor_ticklabels._set_external_pad(0) @@ -1301,9 +1323,20 @@ #pad_points = self.major_tick_pad - axislabel_pad = max([self.major_ticklabels._axislabel_pad, - self.minor_ticklabels._axislabel_pad]) + #print self._ticklabel_add_angle - self._axislabel_add_angle + #if abs(self._ticklabel_add_angle - self._axislabel_add_angle)%360 > 90: + if self._ticklabel_add_angle != self._axislabel_add_angle: + if (self.major_ticks.get_visible() and not self.major_ticks.get_tick_out()) \ + or \ + (self.minor_ticks.get_visible() and not self.major_ticks.get_tick_out()): + axislabel_pad = self.major_ticks._ticksize + else: + axislabel_pad = 0 + else: + axislabel_pad = max([self.major_ticklabels._axislabel_pad, + self.minor_ticklabels._axislabel_pad]) + #label_offset = axislabel_pad + self.LABELPAD #self.label._set_offset_radius(label_offset) @@ -1341,6 +1374,7 @@ self._draw_line(renderer) + self._draw_ticks(renderer) #self._draw_offsetText(renderer) Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py =================================================================== --- trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py 2010年03月02日 01:47:48 UTC (rev 8166) +++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py 2010年03月02日 01:47:54 UTC (rev 8167) @@ -336,11 +336,16 @@ get_label_transform() returns a transform of (transAxes+offset) """ loc = self._axis_direction - angle = dict(left=0, - right=0, - bottom=.5*np.pi, - top=.5*np.pi)[loc] + #angle = dict(left=0, + # right=0, + # bottom=.5*np.pi, + # top=.5*np.pi)[loc] + if self.nth_coord == 0: + angle = 0 + else: + angle = 90 + _verts = [0.5, 0.5] fixed_coord = 1-self.nth_coord @@ -369,6 +374,11 @@ else: angle_normal, angle_tangent = 0, 90 + if self.nth_coord == 0: + angle_normal, angle_tangent = 90, 0 + else: + angle_normal, angle_tangent = 0, 90 + #angle = 90 - 90 * self.nth_coord major = self.axis.major This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8166 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8166&view=rev Author: leejjoon Date: 2010年03月02日 01:47:48 +0000 (2010年3月02日) Log Message: ----------- update axes_grid.axislines doc. Modified Paths: -------------- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/demo_ticklabel_direction.py trunk/matplotlib/doc/mpl_toolkits/axes_grid/users/axislines.rst Added Paths: ----------- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step01.py trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step02.py trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step03.py trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step04.py trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction01.py trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction02.py trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction03.py Added: trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step01.py =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step01.py (rev 0) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step01.py 2010年03月02日 01:47:48 UTC (rev 8166) @@ -0,0 +1,25 @@ +import matplotlib.pyplot as plt +import mpl_toolkits.axes_grid.axislines as axislines + +def setup_axes(fig, rect): + ax = axislines.Subplot(fig, rect) + fig.add_axes(ax) + + ax.set_ylim(-0.1, 1.5) + ax.set_yticks([0, 1]) + + ax.axis[:].set_visible(False) + + ax.axis["x"] = ax.new_floating_axis(1, 0.5) + ax.axis["x"].set_axisline_style("->", size=1.5) + + return ax + +fig = plt.figure(figsize=(3,2.5)) +fig.subplots_adjust(top=0.8) +ax1 = setup_axes(fig, "111") + +ax1.axis["x"].set_axis_direction("left") + + +plt.show() Added: trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step02.py =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step02.py (rev 0) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step02.py 2010年03月02日 01:47:48 UTC (rev 8166) @@ -0,0 +1,36 @@ +import matplotlib.pyplot as plt +import mpl_toolkits.axes_grid.axislines as axislines + +def setup_axes(fig, rect): + ax = axislines.Subplot(fig, rect) + fig.add_axes(ax) + + ax.set_ylim(-0.1, 1.5) + ax.set_yticks([0, 1]) + + #ax.axis[:].toggle(all=False) + #ax.axis[:].line.set_visible(False) + ax.axis[:].set_visible(False) + + ax.axis["x"] = ax.new_floating_axis(1, 0.5) + ax.axis["x"].set_axisline_style("->", size=1.5) + + return ax + +fig = plt.figure(figsize=(6,2.5)) +fig.subplots_adjust(bottom=0.2, top=0.8) + +ax1 = setup_axes(fig, "121") +ax1.axis["x"].set_ticklabel_direction("+") +ax1.annotate("ticklabel direction=$+$", (0.5, 0), xycoords="axes fraction", + xytext=(0, -10), textcoords="offset points", + va="top", ha="center") + +ax2 = setup_axes(fig, "122") +ax2.axis["x"].set_ticklabel_direction("-") +ax2.annotate("ticklabel direction=$-$", (0.5, 0), xycoords="axes fraction", + xytext=(0, -10), textcoords="offset points", + va="top", ha="center") + + +plt.show() Added: trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step03.py =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step03.py (rev 0) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step03.py 2010年03月02日 01:47:48 UTC (rev 8166) @@ -0,0 +1,40 @@ +import matplotlib.pyplot as plt +import mpl_toolkits.axes_grid.axislines as axislines + +def setup_axes(fig, rect): + ax = axislines.Subplot(fig, rect) + fig.add_axes(ax) + + ax.set_ylim(-0.1, 1.5) + ax.set_yticks([0, 1]) + + #ax.axis[:].toggle(all=False) + #ax.axis[:].line.set_visible(False) + ax.axis[:].set_visible(False) + + ax.axis["x"] = ax.new_floating_axis(1, 0.5) + ax.axis["x"].set_axisline_style("->", size=1.5) + + return ax + +fig = plt.figure(figsize=(6,2.5)) +fig.subplots_adjust(bottom=0.2, top=0.8) + +ax1 = setup_axes(fig, "121") +ax1.axis["x"].label.set_text("Label") +ax1.axis["x"].toggle(ticklabels=False) +ax1.axis["x"].set_axislabel_direction("+") +ax1.annotate("label direction=$+$", (0.5, 0), xycoords="axes fraction", + xytext=(0, -10), textcoords="offset points", + va="top", ha="center") + +ax2 = setup_axes(fig, "122") +ax2.axis["x"].label.set_text("Label") +ax2.axis["x"].toggle(ticklabels=False) +ax2.axis["x"].set_axislabel_direction("-") +ax2.annotate("label direction=$-$", (0.5, 0), xycoords="axes fraction", + xytext=(0, -10), textcoords="offset points", + va="top", ha="center") + + +plt.show() Added: trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step04.py =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step04.py (rev 0) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/axis_direction_demo_step04.py 2010年03月02日 01:47:48 UTC (rev 8166) @@ -0,0 +1,54 @@ +import matplotlib.pyplot as plt +import mpl_toolkits.axes_grid.axislines as axislines + +def setup_axes(fig, rect): + ax = axislines.Subplot(fig, rect) + fig.add_axes(ax) + + ax.set_ylim(-0.1, 1.5) + ax.set_yticks([0, 1]) + + ax.axis[:].set_visible(False) + + ax.axis["x1"] = ax.new_floating_axis(1, 0.3) + ax.axis["x1"].set_axisline_style("->", size=1.5) + + ax.axis["x2"] = ax.new_floating_axis(1, 0.7) + ax.axis["x2"].set_axisline_style("->", size=1.5) + + return ax + +fig = plt.figure(figsize=(6,2.5)) +fig.subplots_adjust(bottom=0.2, top=0.8) + +ax1 = setup_axes(fig, "121") +ax1.axis["x1"].label.set_text("rotation=0") +ax1.axis["x1"].toggle(ticklabels=False) + +ax1.axis["x2"].label.set_text("rotation=10") +ax1.axis["x2"].label.set_rotation(10) +ax1.axis["x2"].toggle(ticklabels=False) + +ax1.annotate("label direction=$+$", (0.5, 0), xycoords="axes fraction", + xytext=(0, -10), textcoords="offset points", + va="top", ha="center") + +ax2 = setup_axes(fig, "122") + +ax2.axis["x1"].set_axislabel_direction("-") +ax2.axis["x2"].set_axislabel_direction("-") + +ax2.axis["x1"].label.set_text("rotation=0") +ax2.axis["x1"].toggle(ticklabels=False) + +ax2.axis["x2"].label.set_text("rotation=10") +ax2.axis["x2"].label.set_rotation(10) +ax2.axis["x2"].toggle(ticklabels=False) + + +ax2.annotate("label direction=$-$", (0.5, 0), xycoords="axes fraction", + xytext=(0, -10), textcoords="offset points", + va="top", ha="center") + + +plt.show() Modified: trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/demo_ticklabel_direction.py =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/demo_ticklabel_direction.py 2010年03月01日 15:58:51 UTC (rev 8165) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/demo_ticklabel_direction.py 2010年03月02日 01:47:48 UTC (rev 8166) @@ -33,8 +33,8 @@ ax.axis["right"].set_axis_direction("left") ax.axis["top"].set_axis_direction("bottom") -ax.axis["left"].major_ticklabels.set_pad(0) -ax.axis["bottom"].major_ticklabels.set_pad(10) +#ax.axis["left"].major_ticklabels.set_pad(0) +#ax.axis["bottom"].major_ticklabels.set_pad(10) Added: trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction01.py =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction01.py (rev 0) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction01.py 2010年03月02日 01:47:48 UTC (rev 8166) @@ -0,0 +1,15 @@ +import matplotlib.pyplot as plt +import mpl_toolkits.axes_grid.axislines as axislines + +fig = plt.figure(figsize=(4,2.5)) +ax1 = fig.add_subplot(axislines.Subplot(fig, "111")) +fig.subplots_adjust(right=0.8) + +ax1.axis["left"].major_ticklabels.set_axis_direction("top") +ax1.axis["left"].label.set_text("Label") + +ax1.axis["right"].label.set_visible(True) +ax1.axis["right"].label.set_text("Label") +ax1.axis["right"].label.set_axis_direction("left") + +plt.show() Added: trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction02.py =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction02.py (rev 0) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction02.py 2010年03月02日 01:47:48 UTC (rev 8166) @@ -0,0 +1,21 @@ + +import matplotlib.pyplot as plt +import mpl_toolkits.axes_grid.axislines as axislines + +def setup_axes(fig, rect): + ax = axislines.Subplot(fig, rect) + fig.add_subplot(ax) + + ax.set_yticks([0.2, 0.8]) + ax.set_xticks([0.2, 0.8]) + + return ax + +fig = plt.figure(1, figsize=(4, 2)) +ax = setup_axes(fig, "111") + +ax.axis[:].major_ticks.set_tick_out(True) + +plt.show() + + Added: trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction03.py =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction03.py (rev 0) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/figures/simple_axis_direction03.py 2010年03月02日 01:47:48 UTC (rev 8166) @@ -0,0 +1,31 @@ + +import matplotlib.pyplot as plt +import mpl_toolkits.axes_grid.axislines as axislines + +def setup_axes(fig, rect): + ax = axislines.Subplot(fig, rect) + fig.add_subplot(ax) + + ax.set_yticks([0.2, 0.8]) + ax.set_xticks([0.2, 0.8]) + + return ax + +fig = plt.figure(1, figsize=(5, 2)) +fig.subplots_adjust(wspace=0.4, bottom=0.3) + +ax1 = setup_axes(fig, "121") +ax1.set_xlabel("X-label") +ax1.set_ylabel("Y-label") + +ax1.axis[:].invert_ticklabel_direction() + +ax2 = setup_axes(fig, "122") +ax2.set_xlabel("X-label") +ax2.set_ylabel("Y-label") + +ax2.axis[:].major_ticks.set_tick_out(True) + +plt.show() + + Modified: trunk/matplotlib/doc/mpl_toolkits/axes_grid/users/axislines.rst =================================================================== --- trunk/matplotlib/doc/mpl_toolkits/axes_grid/users/axislines.rst 2010年03月01日 15:58:51 UTC (rev 8165) +++ trunk/matplotlib/doc/mpl_toolkits/axes_grid/users/axislines.rst 2010年03月02日 01:47:48 UTC (rev 8166) @@ -102,7 +102,52 @@ The ticklabels and axislabel of the top and the right axis are set to not visible. +For example, if you want to change the color attributes of +major_ticklabels of the bottom x-axis :: + ax.axis["bottom"].major_ticklabels.set_color("b") + +Similarly, to make ticklabels invisible :: + + ax.axis["bottom"].major_ticklabels.set_visible(False) + +AxisAritst provides a helper method to control the visibility of ticks, ticklabels, and label. To make ticklabel invisible, :: + + ax.axis["bottom"].toggle(ticklabels=False) + +To make all of ticks, ticklabels, and (axis) label invisible :: + + ax.axis["bottom"].toggle(all=False) + +To turn all off but ticks on :: + + ax.axis["bottom"].toggle(all=False, ticks=True) + +To turn all on but (axis) label off :: + + ax.axis["bottom"].toggle(all=True, label=False)) + + +ax.axis's __getitem__ method can take multiple axis names. For +example, to turn ticklabels of "top" and "right" axis on, :: + + ax.axis["top","right"].toggle(ticklabels=True)) + +Note that 'ax.axis["top","right"]' returns a simple proxy object that translate above code to something like below. :: + + for n in ["top","right"]: + ax.axis[n].toggle(ticklabels=True)) + +So, any return values in the for loop are ignored. And you shoud not +use it anything more than a simple method. + +Like the list indexing ":" means all items, i.e., :: + + ax.axis[:].major_ticks.set_color("r") + +changes tick color in all axis. + + HowTo ===== @@ -138,25 +183,149 @@ To change the pad between ticklabels and axis label, axis.label.set_pad method. -Examples -======== -Adjusting axis_direction ------------------------- +Rotaion and Alignment of TickLabels +=================================== +This is also quite different from the original mpl and can be +confusing. When you want to rotate the ticklabels, first consider +using "set_axis_direction" method. :: + + ax1.axis["left"].major_ticklabels.set_axis_direction("top") + ax1.axis["right"].label.set_axis_direction("left") + +.. plot:: mpl_toolkits/axes_grid/figures/simple_axis_direction01.py + +The parameter for set_axis_direction is one of ["left", "right", +"bottom", "top"]. + +You must understand some underlying concept of directions. + + 1. There is a reference direction which is defined as the direction + of the axis line with increasing coordinate. For example, the + reference direction of the left x-axis is from bottom to top. + + .. plot:: mpl_toolkits/axes_grid/figures/axis_direction_demo_step01.py + + The direction, text angle, and alignments of the ticks, ticklabels and + axis-label is determined width respect to the reference direction + + 2. *ticklabel_direction* is either the right-hand side (+) of the + reference direction or the left-hand side (-). + + .. plot:: mpl_toolkits/axes_grid/figures/axis_direction_demo_step02.py + + 3. same for the *label_direction* + + .. plot:: mpl_toolkits/axes_grid/figures/axis_direction_demo_step03.py + + 4. ticks are by default drawn toward the opposite direction of the ticklabels. + + 5. text rotation of ticklabels and label is determined in reference + to the *ticklabel_direction* or *label_direction*, + respectively. The rotation of ticklabels and tlabel is anchored. + + .. plot:: mpl_toolkits/axes_grid/figures/axis_direction_demo_step04.py + + +On the other hand, there is a concept of "axis_direction". This is a +default setting of above properties for each, "bottom", "left", "top", +and "right" axis. + + ========== =========== ========= ========== ========= ========== + ? ? left bottom right top + ---------- ----------- --------- ---------- --------- ---------- + axislabel direction '-' '+' '+' '-' + axislabel rotation 180 0 0 180 + axislabel va center top center bottom + axislabel ha right center right center + ticklabel direction '-' '+' '+' '-' + ticklabels rotation 90 0 -90 180 + ticklabel ha right center right center + ticklabel va center baseline center baseline + ========== =========== ========= ========== ========= ========== + + +And, 'set_axis_direction("top")' means to adjust the text rotation +etc, for settings suitable for "top" axis. The concept of axis +direction can be more clear with curved axis. + .. plot:: mpl_toolkits/axes_grid/figures/demo_axis_direction.py +The axis_drection can be adjusted in the AxisArtist level, or in the +level of its child arists, i.e., ticks, ticklabels, and axis-label. :: + + ax1.axis["left"].set_axis_direction("top") + +changes axis_direction of all the associated artist with the "left" +axis, while :: + + ax1.axis["left"].major_ticklabels.set_axis_direction("top") + +changes the axis_direction of only the major_ticklabels. Note that +set_axis_direction in the AxisArtist level changes the +ticklabel_direction and label_direction, while chainging the +axis_direction of ticks, ticklabels, and axis-label does not affect +them. + + +If you want to make ticks outward and ticklabels inside the axes, +use invert_ticklabel_direction method. :: + + ax.axis[:].invert_ticklabel_direction() + +A related method is "set_tick_out". It makes ticks outward (as a +matter of fact, it makes ticks toward the opposite direction of the +default direction). :: + + ax.axis[:].major_ticks.set_tick_out(True) + +.. plot:: mpl_toolkits/axes_grid/figures/simple_axis_direction03.py + + +So, in summary, + + * AxisArtist's methods + * set_axis_direction : "left", "right", "bottom", or "top" + * set_ticklabel_direction : "+" or "-" + * set_axislabel_direction : "+" or "-" + * invert_ticklabel_direction + * Ticks' methods (major_ticks and minor_ticks) + * set_tick_out : True or False + * set_ticksize : size in points + * TickLabels' methods (major_ticklabels and minor_ticklabels) + * set_axis_direction : "left", "right", "bottom", or "top" + * set_rotation : angle with respect to the renference direction + * set_ha and set_va : see below + * AxisLabels' methods (label) + * set_axis_direction : "left", "right", "bottom", or "top" + * set_rotation : angle with respect to the renference direction + * set_ha and set_va + + + Adjusting ticklabels alignment ------------------------------ +Alignment of TickLabels are treated specially. See below + .. plot:: mpl_toolkits/axes_grid/figures/demo_ticklabel_alignment.py -Adjusting ticklabels pad ------------------------- +Adjusting pad +-------------- -.. plot:: mpl_toolkits/axes_grid/figures/demo_ticklabel_direction.py +To change the pad between ticks and ticklabels :: + ax.axis["left"].major_ticklabels.set_pad(10) +Or ticklabels and axis-label :: + + ax.axis["left"].label.set_pad(10) + + +.. plot:: mpl_toolkits/axes_grid/figures/simple_axis_pad.py + + GridHelper ========== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.