MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / format_axes

Function format_axes

galleries/examples/scales/symlog_demo.py:50–59  ·  view source on GitHub ↗

A helper function to better visualize properties of the symlog scale.

(ax, title=None)

Source from the content-addressed store, hash-verified

48
49
50def format_axes(ax, title=None):
51 """A helper function to better visualize properties of the symlog scale."""
52 ax.xaxis.get_minor_locator().set_params(subs=[2, 3, 4, 5, 6, 7, 8, 9])
53 ax.grid()
54 ax.xaxis.grid(which='minor') # minor grid on too
55 linthresh = ax.xaxis.get_transform().linthresh
56 linscale = ax.xaxis.get_transform().linscale
57 ax.axvspan(-linthresh, linthresh, color='0.9')
58 if title:
59 ax.set_title(title.format(linthresh=linthresh, linscale=linscale))
60
61
62x = np.linspace(-60, 60, 201)

Callers 1

symlog_demo.pyFile · 0.70

Calls 6

get_minor_locatorMethod · 0.80
axvspanMethod · 0.80
set_paramsMethod · 0.45
gridMethod · 0.45
get_transformMethod · 0.45
set_titleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…