mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-04 14:14:22 +08:00
fix ligand network cropping bug (#1822)
* fix ligand network cropping bug * move to upstream func * whitespace
This commit is contained in:
23
news/fix_image_crop.rst
Normal file
23
news/fix_image_crop.rst
Normal file
@@ -0,0 +1,23 @@
|
||||
**Added:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Changed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Deprecated:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**Removed:**
|
||||
|
||||
* <news item>
|
||||
|
||||
**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 <https://github.com/OpenFreeEnergy/openfe/pull/1822>`_).
|
||||
|
||||
**Security:**
|
||||
|
||||
* <news item>
|
||||
@@ -142,7 +142,7 @@ class LigandNode(Node):
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user