plot_tricks

File Purpose: misc tricks related to plotting

stuff that’s sometimes easy to forget, but super useful if you remember it.

Functions

ax_aspect(ax)

ax_outline([ax, color, linewidth])

draw a box around the axes

ax_remove_ticklabels([ax])

remove ticklabels from the axes (but don't remove ticks)!

ax_remove_ticks([ax])

remove ticks from the axes!

fig_outline([fig, color, linewidth])

draw a box around the figure

get_colorbar_axes([fig])

return list of all colorbar axes on the figure (current figure if fig is None).

get_min_n_ticks([ax])

get the minimum number of ticks on this axes (current axes if None provided).

plot_locations([margin])

dict of xy=(x,y) in axes coordinates (0=left/bottom, 1=right/top) for various locations;

plot_note(note[, loc, margin, ax, xy])

add this note to the current plot at the indicated position.

plt_transformer([xy, ax])

simple result useful for 'transform' kwarg for plotting functions.

set_min_n_ticks(n[, ax, fail_ok])

set the minimum number of ticks on this axes (current axes if None provided).

use_simple_log_tick_locator([ax, x, base])

tell log-scaled axes of ax to use SimpleLogTickLocator.

use_simple_ticks_renamer(x, f[, ax])

simple tick formatter, changes tick names from val to f(val).

Classes

SimpleLogTickLocator([base])

simple LogLocator: puts base^N for every next power of base.