Skip to content

Commit

Permalink
modified: src/DiaModality/ModalityPlot.py
Browse files Browse the repository at this point in the history
	modified:   src/DiaModality/_version.py
  • Loading branch information
konung-yaropolk committed Dec 6, 2024
1 parent 6a365a6 commit 62957d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions src/DiaModality/ModalityPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def show(self):
def save(self,
filename,
type='png',
transparent=False):
transparent=False):
plt.savefig('{}.{}'.format(filename, type), transparent=transparent)


Expand Down Expand Up @@ -81,7 +81,8 @@ def __init__(
linewidth=0.5,
alpha=0.8,
same_scale=False, # Draw all the subplots in the same scale
full_center=True, # Draw all vectors in the central subplot, else draw trimodal vectors only
# Draw all vectors in the central subplot, else draw trimodal vectors only
full_center=True,
whole_sum=True, # Calculate all three modality vectors despite binarization
figsize=(10, 10),
title='',
Expand Down Expand Up @@ -264,13 +265,13 @@ def __draw_subplot(self, ax, resultants, modality_pattern, modalities) -> None:
for resultant, data_row, bin_row in zip(resultants, self.data, self.binarization):

if (resultant
and np.array_equal(bin_row, modality_pattern)
or (self.full_center
and modality_pattern == (True, True, True)
and (tuple(bin_row) not in self.modality_patterns[:3]
or self.whole_sum
)
)
and np.array_equal(bin_row, modality_pattern)
or (self.full_center
and modality_pattern == (True, True, True)
and (tuple(bin_row) not in self.modality_patterns[:3]
or self.whole_sum
)
)
):

# defining the modality of responce to apply color and z-order
Expand All @@ -296,6 +297,9 @@ def __draw_subplot(self, ax, resultants, modality_pattern, modalities) -> None:
if self.scalecircle:
self.__draw_scalecircle(ax)

if not self.whole_sum and sum(modality_pattern) == 1:
ax.set_visible(False)

def _make_layout(self) -> None:
'''
Make figure layout,
Expand All @@ -304,15 +308,11 @@ def _make_layout(self) -> None:

# Defining layout
gs = gridspec.GridSpec(20, 20, figure=self.fig)
# fig.add_subplot(gs[1:11, 5:15], polar=True)
ax1 = self.fig.add_subplot(gs[7:17, 1:11], polar=True)
# fig.add_subplot(gs[7:17, 1:11], polar=True)
ax2 = self.fig.add_subplot(gs[1:11, 5:15], polar=True)
ax3 = self.fig.add_subplot(gs[7:17, 9:19], polar=True)
ax12 = self.fig.add_subplot(gs[4:14, 3:13], polar=True)
# fig.add_subplot(gs[4:14, 7:17], polar=True)
ax13 = self.fig.add_subplot(gs[7:17, 5:15], polar=True)
# fig.add_subplot(gs[7:17, 5:15], polar=True)
ax23 = self.fig.add_subplot(gs[4:14, 7:17], polar=True)
ax0 = self.fig.add_subplot(gs[5:15, 5:15], polar=True)
subplots = (ax1, ax2, ax3, ax12, ax13, ax23, ax0)
Expand Down
2 changes: 1 addition & 1 deletion src/DiaModality/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.6"
__version__ = "0.1.7"

0 comments on commit 62957d6

Please sign in to comment.