Update coordinate_systems.py

This commit is contained in:
Bill Xi 2022-05-21 15:52:56 +08:00 committed by GitHub
parent cfded00f13
commit 3108b49f55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,14 +128,16 @@ class CoordinateSystem(ABC):
axis: np.ndarray,
edge: np.ndarray,
direction: np.ndarray,
buff: float = MED_SMALL_BUFF
buff: float = MED_SMALL_BUFF,
ensure_on_screen: bool = False
) -> Tex:
label = Tex(label_tex)
label.next_to(
axis.get_edge_center(edge), direction,
buff=buff
)
label.shift_onto_screen(buff=MED_SMALL_BUFF)
if ensure_on_screen:
label.shift_onto_screen(buff=MED_SMALL_BUFF)
return label
def get_axis_labels(