Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cleanup axisartist tutorial. #15505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions tutorials/toolkits/axisartist.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@
Or a fixed axis with some offset ::

# make new (right-side) yaxis, but with some offset
ax.axis["right2"] = ax.new_fixed_axis(loc="right",
offset=(20, 0))
ax.axis["right2"] = ax.new_fixed_axis(loc="right", offset=(20, 0))

axisartist with ParasiteAxes
----------------------------
Expand Down Expand Up @@ -262,17 +261,18 @@

To turn all on but (axis) label off ::

ax.axis["bottom"].toggle(all=True, label=False))
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))
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. ::
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))
for n in ["top", "right"]:
ax.axis[n].toggle(ticklabels=True)

So, any return values in the for loop are ignored. And you should not
use it anything more than a simple method.
Expand Down Expand Up @@ -301,7 +301,7 @@

3. To change the attributes of multiple axis::

ax.axis["left","bottom"].major_ticklabels.set_color("r")
ax.axis["left", "bottom"].major_ticklabels.set_color("r")

or to change the attributes of all axis::

Expand Down Expand Up @@ -450,22 +450,22 @@

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 reference 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 reference direction
* set_ha and set_va
* 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 reference 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 reference direction
* set_ha and set_va

Adjusting ticklabels alignment
------------------------------
Expand Down Expand Up @@ -541,8 +541,8 @@ def inv_tr(x, y):
# system in degree
tr = Affine2D().scale(np.pi/180., 1.) + PolarAxes.PolarTransform()

# extreme finder : find a range of coordinate.
# 20, 20 : number of sampling points along x, y direction
# extreme finder: find a range of coordinate.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not change this one occurence. There seems to be some consistency in having a space before the colon throughout the tutorial. Either change all or none.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they're all changed now to no space (double colons at end of paragraphs introducing code blocks don't show up in the rendered html so are irrelevant here).

# 20, 20: number of sampling points along x, y direction
# The first coordinate (longitude, but theta in polar)
# has a cycle of 360 degree.
# The second coordinate (latitude, but radius in polar) has a minimum of 0
Expand Down