|
87 | 87 | Or a fixed axis with some offset :: |
88 | 88 |
|
89 | 89 | # make new (right-side) yaxis, but with some offset |
90 | | - ax.axis["right2"] = ax.new_fixed_axis(loc="right", |
91 | | - offset=(20, 0)) |
| 90 | + ax.axis["right2"] = ax.new_fixed_axis(loc="right", offset=(20, 0)) |
92 | 91 |
|
93 | 92 | axisartist with ParasiteAxes |
94 | 93 | ---------------------------- |
|
262 | 261 |
|
263 | 262 | To turn all on but (axis) label off :: |
264 | 263 |
|
265 | | - ax.axis["bottom"].toggle(all=True, label=False)) |
| 264 | + ax.axis["bottom"].toggle(all=True, label=False) |
266 | 265 |
|
267 | 266 | ax.axis's __getitem__ method can take multiple axis names. For |
268 | 267 | example, to turn ticklabels of "top" and "right" axis on, :: |
269 | 268 |
|
270 | | - ax.axis["top","right"].toggle(ticklabels=True)) |
| 269 | + ax.axis["top", "right"].toggle(ticklabels=True) |
271 | 270 |
|
272 | | -Note that 'ax.axis["top","right"]' returns a simple proxy object that translate above code to something like below. :: |
| 271 | +Note that 'ax.axis["top", "right"]' returns a simple proxy object that |
| 272 | +translate above code to something like below. :: |
273 | 273 |
|
274 | | - for n in ["top","right"]: |
275 | | - ax.axis[n].toggle(ticklabels=True)) |
| 274 | + for n in ["top", "right"]: |
| 275 | + ax.axis[n].toggle(ticklabels=True) |
276 | 276 |
|
277 | 277 | So, any return values in the for loop are ignored. And you should not |
278 | 278 | use it anything more than a simple method. |
|
301 | 301 |
|
302 | 302 | 3. To change the attributes of multiple axis:: |
303 | 303 |
|
304 | | - ax.axis["left","bottom"].major_ticklabels.set_color("r") |
| 304 | + ax.axis["left", "bottom"].major_ticklabels.set_color("r") |
305 | 305 |
|
306 | 306 | or to change the attributes of all axis:: |
307 | 307 |
|
|
450 | 450 |
|
451 | 451 | So, in summary, |
452 | 452 |
|
453 | | - * AxisArtist's methods |
454 | | - * set_axis_direction : "left", "right", "bottom", or "top" |
455 | | - * set_ticklabel_direction : "+" or "-" |
456 | | - * set_axislabel_direction : "+" or "-" |
457 | | - * invert_ticklabel_direction |
458 | | - * Ticks' methods (major_ticks and minor_ticks) |
459 | | - * set_tick_out : True or False |
460 | | - * set_ticksize : size in points |
461 | | - * TickLabels' methods (major_ticklabels and minor_ticklabels) |
462 | | - * set_axis_direction : "left", "right", "bottom", or "top" |
463 | | - * set_rotation : angle with respect to the reference direction |
464 | | - * set_ha and set_va : see below |
465 | | - * AxisLabels' methods (label) |
466 | | - * set_axis_direction : "left", "right", "bottom", or "top" |
467 | | - * set_rotation : angle with respect to the reference direction |
468 | | - * set_ha and set_va |
| 453 | +* AxisArtist's methods |
| 454 | + * set_axis_direction: "left", "right", "bottom", or "top" |
| 455 | + * set_ticklabel_direction: "+" or "-" |
| 456 | + * set_axislabel_direction: "+" or "-" |
| 457 | + * invert_ticklabel_direction |
| 458 | +* Ticks' methods (major_ticks and minor_ticks) |
| 459 | + * set_tick_out: True or False |
| 460 | + * set_ticksize: size in points |
| 461 | +* TickLabels' methods (major_ticklabels and minor_ticklabels) |
| 462 | + * set_axis_direction: "left", "right", "bottom", or "top" |
| 463 | + * set_rotation: angle with respect to the reference direction |
| 464 | + * set_ha and set_va: see below |
| 465 | +* AxisLabels' methods (label) |
| 466 | + * set_axis_direction: "left", "right", "bottom", or "top" |
| 467 | + * set_rotation: angle with respect to the reference direction |
| 468 | + * set_ha and set_va |
469 | 469 |
|
470 | 470 | Adjusting ticklabels alignment |
471 | 471 | ------------------------------ |
@@ -541,8 +541,8 @@ def inv_tr(x, y): |
541 | 541 | # system in degree |
542 | 542 | tr = Affine2D().scale(np.pi/180., 1.) + PolarAxes.PolarTransform() |
543 | 543 |
|
544 | | - # extreme finder : find a range of coordinate. |
545 | | - # 20, 20 : number of sampling points along x, y direction |
| 544 | + # extreme finder: find a range of coordinate. |
| 545 | + # 20, 20: number of sampling points along x, y direction |
546 | 546 | # The first coordinate (longitude, but theta in polar) |
547 | 547 | # has a cycle of 360 degree. |
548 | 548 | # The second coordinate (latitude, but radius in polar) has a minimum of 0 |
|
0 commit comments