Skip to content

Commit

Permalink
Rename parameter and add annotation
Browse files Browse the repository at this point in the history
Fix typo
  • Loading branch information
sbaldu committed May 2, 2024
1 parent f7b3e1c commit 80f3f7e
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions CLUEstering/CLUEstering.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,11 +762,12 @@ def output_df(self) -> pd.DataFrame:
return self.clust_prop.output_df


def input_plotter(self, plot_title: str = '', title_size: float = 16,
x_label: str = 'x', y_label: str = 'y', z_label: str = 'z',
label_size: float = 16, pt_size: float = 1, pt_colour: str = 'b',
grid: bool = True, grid_style: str = '--', grid_size: float = 0.2,
x_ticks=None, y_ticks=None, z_ticks=None, file_name=None, **kwargs) -> None:
def input_plotter(self, filepath: Union[str, None] = None, plot_title: str = '',
title_size: float = 16, x_label: str = 'x', y_label: str = 'y',
z_label: str = 'z', label_size: float = 16, pt_size: float = 1,
pt_colour: str = 'b', grid: bool = True, grid_style: str = '--',
grid_size: float = 0.2, x_ticks=None, y_ticks=None, z_ticks=None,
**kwargs) -> None:
"""
Plots the points in input.
Expand Down Expand Up @@ -841,8 +842,8 @@ def input_plotter(self, plot_title: str = '', title_size: float = 16,
if y_ticks is not None:
plt.yticks(y_ticks)

if file_name is not None:
plt.savefig(file_name)
if filepath is not None:
plt.savefig(filepath)
else:
plt.show()
elif self.clust_data.n_dim == 2:
Expand All @@ -868,8 +869,8 @@ def input_plotter(self, plot_title: str = '', title_size: float = 16,
if y_ticks is not None:
plt.yticks(y_ticks)

if file_name is not None:
plt.savefig(file_name)
if filepath is not None:
plt.savefig(filepath)
else:
plt.show()
else:
Expand Down Expand Up @@ -901,17 +902,17 @@ def input_plotter(self, plot_title: str = '', title_size: float = 16,
if z_ticks is not None:
ax_.set_zticks(z_ticks)

if file_name is not None:
plt.savefig(file_name)
if filepath is not None:
plt.savefig(filepath)
else:
plt.show()

def cluster_plotter(self, plot_title: str = '', title_size: float = 16,
x_label: str = 'x', y_label: str = 'y', z_label: str = 'z',
label_size: float = 16, outl_size: float = 10, pt_size: float = 10,
seed_size: float = 25, grid: bool = True, grid_style: str = '--',
grid_size: float = 0.2, x_ticks=None, y_ticks=None, z_ticks=None,
file_name=None, **kwargs) -> None:
def cluster_plotter(self, filepath: Union[str, None] = None, plot_title: str = '',
title_size: float = 16, x_label: str = 'x', y_label: str = 'y',
z_label: str = 'z', label_size: float = 16, outl_size: float = 10,
pt_size: float = 10, seed_size: float = 25, grid: bool = True,
grid_style: str = '--', grid_size: float = 0.2, x_ticks=None,
y_ticks=None, z_ticks=None, **kwargs) -> None:
"""
Plots the clusters with a different colour for every cluster.
Expand Down Expand Up @@ -1002,8 +1003,8 @@ def cluster_plotter(self, plot_title: str = '', title_size: float = 16,
if y_ticks is not None:
plt.yticks(y_ticks)

if file_name is not None:
plt.savefig(file_name)
if filepath is not None:
plt.savefig(filepath)
else:
plt.show()
elif self.clust_data.n_dim == 2:
Expand Down Expand Up @@ -1040,8 +1041,8 @@ def cluster_plotter(self, plot_title: str = '', title_size: float = 16,
if y_ticks is not None:
plt.yticks(y_ticks)

if file_name is not None:
plt.savefig(file_name)
if filepath is not None:
plt.savefig(filepath)
else:
plt.show()
else:
Expand Down Expand Up @@ -1085,8 +1086,8 @@ def cluster_plotter(self, plot_title: str = '', title_size: float = 16,
if z_ticks is not None:
ax_.set_zticks(z_ticks)

if file_name is not None:
plt.savefig(file_name)
if filepath is not None:
plt.savefig(filepath)
else:
plt.show()

Expand Down

0 comments on commit 80f3f7e

Please sign in to comment.