diff --git a/news/fix_image_crop.rst b/news/fix_image_crop.rst new file mode 100644 index 000000000..3d1f1d31c --- /dev/null +++ b/news/fix_image_crop.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fixed bug in ligand network visualization (such as with ``openfe view-ligand-network``) so that ligand names are no longer cut off by the plot border (`PR 1822 `_). + +**Security:** + +* diff --git a/src/openfe/utils/atommapping_network_plotting.py b/src/openfe/utils/atommapping_network_plotting.py index 844dcc994..13d899d66 100644 --- a/src/openfe/utils/atommapping_network_plotting.py +++ b/src/openfe/utils/atommapping_network_plotting.py @@ -142,7 +142,7 @@ def xy(self): class AtomMappingNetworkDrawing(GraphDrawing): """ - Class for drawing atom mappings from a provided ligang network. + Class for drawing atom mappings from a provided ligand network. Parameters ---------- @@ -167,6 +167,12 @@ def plot_atommapping_network(network: LigandNetwork): Returns ------- :class:`matplotlib.figure.Figure` : - the matplotlib figure containing the iteractive visualization + the matplotlib figure containing the interactive visualization """ - return AtomMappingNetworkDrawing(network.graph).fig + fig = AtomMappingNetworkDrawing(network.graph).fig + axes = fig.axes + for ax in axes: + ax.set_frame_on(False) # remove the black frame + for t in ax.texts: + t.set_clip_on(False) # do not clip the label in the network plot + return fig