diff --git a/prospr/_version.py b/prospr/_version.py index fc0b1c7..70f1ec7 100644 --- a/prospr/_version.py +++ b/prospr/_version.py @@ -1 +1 @@ -__version__ = "1.2.17" +__version__ = "1.2.18" diff --git a/prospr/visualize.py b/prospr/visualize.py index 3655ec5..29f2911 100644 --- a/prospr/visualize.py +++ b/prospr/visualize.py @@ -493,6 +493,9 @@ def plot_protein( protein, df, ax, linewidth, markersize, annotate_first ) + # Transform axis limits to make protein segments squared. + ax.axis("equal") + # If adding legend, remove title from legend and add item for bonds. if legend: handles, labels = ax.get_legend_handles_labels() @@ -520,7 +523,8 @@ def plot_protein( linestyle="None", markerfacecolor="white", markeredgecolor=COLOR_ANNOTATE, - markeredgewidth=2, + markeredgewidth=1.75, + markersize=10, label="Head", ) handles.append(annotate_patch) diff --git a/tests/visualize/test_visualization.py b/tests/visualize/test_visualization.py index fcffbcc..1de42c5 100644 --- a/tests/visualize/test_visualization.py +++ b/tests/visualize/test_visualization.py @@ -66,6 +66,16 @@ def test_2d_visualization(self, show=False): show=False, ) + p = Protein("HPPHPPPHPPPPPHH", dim=2, model="HP") + p.set_hash([-1, -2, 1, -2, 1, 2, 2, 1, 2, 2, -1, -1, -2, 1]) + plot_protein( + p, + style="paper", + legend_style="outer", + annotate_first=True, + show=False, + ) + p = Protein("HHPHPHPPPHPHHHPPPPPPHPPPH", dim=2, model="HP") p.set_hash( [