A helper function to better visualize properties of the symlog scale.
(ax, title=None)
| 48 | |
| 49 | |
| 50 | def 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 | |
| 62 | x = np.linspace(-60, 60, 201) |
no test coverage detected
searching dependent graphs…