INNER CODE UNIT · Python
offset
lgienapp/aquarel · aquarel/transforms.py:27
def offset(distance: int):
"""
Offsets the plot spines.
Code partly taken from https://github.com/mwaskom/seaborn/blob/563e96d3be1eaee8db8dfbccf7eed1f1c66dfd31/seaborn/utils.py#L292
:param distance: offset distance int pt.
"""
axes = plt.gcf().axes
for ax_i in axes:
for side in ["top", "right", "left", "bottom"]:
ax_i.spines[side].set_position(("outward", distance))
def trim(axis: str):
"""
Trims axes of a plot to first and last major tick.
Code partly taken from https://github.com/mwaskom/seaborn/blob/563e96d3be1eaee8db8dfbccf7eed1f1c66dfd31/seaborn/utils.py#L292