Skip to content

Commit

Permalink
updated properties and scatterplots with larger font
Browse files Browse the repository at this point in the history
  • Loading branch information
hechth committed May 17, 2024
1 parent 21129ca commit 46ce75a
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 45 deletions.
20 changes: 14 additions & 6 deletions analysis/Python_scripts/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ def scatterplot_matplotlib(df: pd.DataFrame) -> plt.Figure:
Returns:
fig (plt.Figure): The plot.
"""
fig = plt.figure(figsize=(18, 6))
_, _, label_fontsize, tick_fontsize, _, _ = init()

fig = plt.figure(figsize=(24, 8))
scatter = plt.scatter(
df['scores'],
df['matches'],
Expand All @@ -288,16 +290,22 @@ def scatterplot_matplotlib(df: pd.DataFrame) -> plt.Figure:
vmin=0,
vmax=100
)
plt.colorbar(scatter).set_label('Reference Matched %')
plt.xlabel('scores')
plt.ylabel('ion matches')
for ax in fig.get_axes():
ax.tick_params(axis='x', labelsize=tick_fontsize)
ax.tick_params(axis='y', labelsize=tick_fontsize)

cbar = plt.colorbar(scatter)
cbar.set_label('ions matching reference (%)', size=label_fontsize)
cbar.ax.tick_params(labelsize=tick_fontsize)
plt.xlabel('scores', fontsize = label_fontsize)
plt.ylabel('ion matches', fontsize = label_fontsize)

# Add a legend for the size
sizes = [1, 50, 100]
for size in sizes:
plt.scatter([], [], c='c', alpha=0.5, s=size * 2, label=str(size))
plt.legend(scatterpoints=1, title='Query Matched %',
labelspacing=1, loc='upper left')
plt.legend(scatterpoints=1, title='ions matching query (%)',
labelspacing=1, loc='upper left', fontsize = tick_fontsize, ncols=3)
return fig

def create_dual_plot(df1: pd.DataFrame, df2: pd.DataFrame,
Expand Down
154 changes: 129 additions & 25 deletions analysis/Python_scripts/properties.ipynb

Large diffs are not rendered by default.

39 changes: 25 additions & 14 deletions analysis/Python_scripts/scatterplot.ipynb

Large diffs are not rendered by default.

0 comments on commit 46ce75a

Please sign in to comment.