Skip to content

Commit

Permalink
Version 1.1.6.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ZitongLu1996 committed Apr 11, 2024
1 parent 00a34d4 commit f0c417b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 22 deletions.
30 changes: 20 additions & 10 deletions build/lib/neurora/rsa_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def plot_rdm_withvalue(rdm, lim=[0, 1], value_fontsize=10, conditions=None, con_

' a function for plotting the correlation coefficients by time sequence '

def plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title_fontsize=16):
def plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title_fontsize=16, labelpad=0):

"""
plot the correlation coefficients by time sequence
Expand All @@ -279,6 +279,8 @@ def plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title
The title of the figure.
title_fontsize : int or float. Default is 16.
The fontsize of the title.
labelpad : int or float. Default is 0.
Distance of ylabel from the y-axis.
"""

if len(np.shape(corrs)) < 2 or len(np.shape(corrs)) > 3:
Expand Down Expand Up @@ -346,7 +348,7 @@ def plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title
plt.plot(x_soft, y_soft[i], linewidth=3)

plt.ylim(ymin, ymax)
plt.ylabel("Similarity", fontsize=20)
plt.ylabel("Similarity", fontsize=20, labelpad=labelpad)
plt.xlabel("Time (s)", fontsize=20)
plt.tick_params(labelsize=18)

Expand All @@ -368,7 +370,8 @@ def plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title
def plot_tbytsim_withstats(similarities, start_time=0, end_time=1, time_interval=0.01, smooth=True, p=0.05, cbpt=True,
clusterp=0.05, stats_time=[0, 1], color='r', xlim=[0, 1], ylim=[-0.1, 0.8],
xlabel='Time (s)', ylabel='Representational Similarity', figsize=[6.4, 3.6], x0=0,
ticksize=12, fontsize=16, markersize=2, title=None, title_fontsize=16, avgshow=False):
labelpad=0, ticksize=12, fontsize=16, markersize=2, title=None, title_fontsize=16,
avgshow=False):

"""
Plot the time-by-time Similarities with statistical results
Expand Down Expand Up @@ -411,6 +414,8 @@ def plot_tbytsim_withstats(similarities, start_time=0, end_time=1, time_interval
The size of the figure.
x0 : float. Default is 0.
The Y-axis is at x=x0.
labelpad : int or float. Default is 0.
Distance of ylabel from the y-axis.
ticksize : int or float. Default is 12.
The size of the ticks.
fontsize : int or float. Default is 16.
Expand Down Expand Up @@ -525,7 +530,7 @@ def plot_tbytsim_withstats(similarities, start_time=0, end_time=1, time_interval
plt.xlim(xlim[0], xlim[1])
plt.tick_params(labelsize=ticksize)
plt.xlabel(xlabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize, labelpad=labelpad)

plt.title(title, fontsize=title_fontsize)
plt.show()
Expand All @@ -537,8 +542,8 @@ def plot_tbytsim_withstats(similarities, start_time=0, end_time=1, time_interval

def plot_tbyt_decoding_acc(acc, start_time=0, end_time=1, time_interval=0.01, chance=0.5, p=0.05, cbpt=True,
clusterp=0.05, stats_time=[0, 1], color='r', xlim=[0, 1], ylim=[0.4, 0.8],
xlabel='Time (s)', ylabel='Decoding Accuracy', figsize=[6.4, 3.6], x0=0, ticksize=12,
fontsize=16, markersize=2, title=None, title_fontsize=16, avgshow=False):
xlabel='Time (s)', ylabel='Decoding Accuracy', figsize=[6.4, 3.6], x0=0, labelpad=0,
ticksize=12, fontsize=16, markersize=2, title=None, title_fontsize=16, avgshow=False):

"""
Plot the time-by-time decoding accuracies
Expand Down Expand Up @@ -579,6 +584,8 @@ def plot_tbyt_decoding_acc(acc, start_time=0, end_time=1, time_interval=0.01, ch
The size of the figure.
x0 : float. Default is 0.
The Y-axis is at x=x0.
labelpad : int or float. Default is 0.
Distance of ylabel from the y-axis.
ticksize : int or float. Default is 12.
The size of the ticks.
fontsize : int or float. Default is 16.
Expand Down Expand Up @@ -677,7 +684,7 @@ def plot_tbyt_decoding_acc(acc, start_time=0, end_time=1, time_interval=0.01, ch
plt.xlim(xlim[0], xlim[1])
plt.tick_params(labelsize=ticksize)
plt.xlabel(xlabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize, labelpad=labelpad)

plt.title(title, fontsize=title_fontsize)
plt.show()
Expand All @@ -689,8 +696,9 @@ def plot_tbyt_decoding_acc(acc, start_time=0, end_time=1, time_interval=0.01, ch
def plot_tbyt_diff_decoding_acc(acc1, acc2, start_time=0, end_time=1, time_interval=0.01, chance=0.5, p=0.05, cbpt=True,
clusterp=0.05, stats_time=[0, 1], color1='r', color2='b', label1='Condition1',
label2='Condition2', xlim=[0, 1], ylim=[0.4, 0.8], xlabel='Time (s)',
ylabel='Decoding Accuracy', figsize=[6.4, 3.6], x0=0, ticksize=12, fontsize=16,
markersize=2, legend_fontsize=14, title=None, title_fontsize=16, avgshow=False):
ylabel='Decoding Accuracy', figsize=[6.4, 3.6], x0=0, labelpad=0, ticksize=12,
fontsize=16, markersize=2, legend_fontsize=14, title=None, title_fontsize=16,
avgshow=False):

"""
Plot the differences of time-by-time decoding accuracies between two conditions
Expand Down Expand Up @@ -741,6 +749,8 @@ def plot_tbyt_diff_decoding_acc(acc1, acc2, start_time=0, end_time=1, time_inter
The size of the figure.
x0 : float. Default is 0.
The Y-axis is at x=x0.
labelpad : int or float. Default is 0.
Distance of ylabel from the y-axis.
ticksize : int or float. Default is 12.
The size of the ticks.
fontsize : int or float. Default is 16.
Expand Down Expand Up @@ -912,7 +922,7 @@ def plot_tbyt_diff_decoding_acc(acc1, acc2, start_time=0, end_time=1, time_inter
plt.xlim(xlim[0], xlim[1])
plt.tick_params(labelsize=ticksize)
plt.xlabel(xlabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize, labelpad=labelpad)
plt.legend()
ax = plt.gca()
leg = ax.get_legend()
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion neurora.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: neurora
Version: 1.1.6.11
Version: 1.1.6.12
Summary: A Python Toolbox for Multimodal Neural Data Representation Analysis
Home-page: https://github.com/ZitongLu1996/NeuroRA
Author: Zitong Lu
Expand Down
30 changes: 20 additions & 10 deletions neurora/rsa_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def plot_rdm_withvalue(rdm, lim=[0, 1], value_fontsize=10, conditions=None, con_

' a function for plotting the correlation coefficients by time sequence '

def plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title_fontsize=16):
def plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title_fontsize=16, labelpad=0):

"""
plot the correlation coefficients by time sequence
Expand All @@ -279,6 +279,8 @@ def plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title
The title of the figure.
title_fontsize : int or float. Default is 16.
The fontsize of the title.
labelpad : int or float. Default is 0.
Distance of ylabel from the y-axis.
"""

if len(np.shape(corrs)) < 2 or len(np.shape(corrs)) > 3:
Expand Down Expand Up @@ -346,7 +348,7 @@ def plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title
plt.plot(x_soft, y_soft[i], linewidth=3)

plt.ylim(ymin, ymax)
plt.ylabel("Similarity", fontsize=20)
plt.ylabel("Similarity", fontsize=20, labelpad=labelpad)
plt.xlabel("Time (s)", fontsize=20)
plt.tick_params(labelsize=18)

Expand All @@ -368,7 +370,8 @@ def plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title
def plot_tbytsim_withstats(similarities, start_time=0, end_time=1, time_interval=0.01, smooth=True, p=0.05, cbpt=True,
clusterp=0.05, stats_time=[0, 1], color='r', xlim=[0, 1], ylim=[-0.1, 0.8],
xlabel='Time (s)', ylabel='Representational Similarity', figsize=[6.4, 3.6], x0=0,
ticksize=12, fontsize=16, markersize=2, title=None, title_fontsize=16, avgshow=False):
labelpad=0, ticksize=12, fontsize=16, markersize=2, title=None, title_fontsize=16,
avgshow=False):

"""
Plot the time-by-time Similarities with statistical results
Expand Down Expand Up @@ -411,6 +414,8 @@ def plot_tbytsim_withstats(similarities, start_time=0, end_time=1, time_interval
The size of the figure.
x0 : float. Default is 0.
The Y-axis is at x=x0.
labelpad : int or float. Default is 0.
Distance of ylabel from the y-axis.
ticksize : int or float. Default is 12.
The size of the ticks.
fontsize : int or float. Default is 16.
Expand Down Expand Up @@ -525,7 +530,7 @@ def plot_tbytsim_withstats(similarities, start_time=0, end_time=1, time_interval
plt.xlim(xlim[0], xlim[1])
plt.tick_params(labelsize=ticksize)
plt.xlabel(xlabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize, labelpad=labelpad)

plt.title(title, fontsize=title_fontsize)
plt.show()
Expand All @@ -537,8 +542,8 @@ def plot_tbytsim_withstats(similarities, start_time=0, end_time=1, time_interval

def plot_tbyt_decoding_acc(acc, start_time=0, end_time=1, time_interval=0.01, chance=0.5, p=0.05, cbpt=True,
clusterp=0.05, stats_time=[0, 1], color='r', xlim=[0, 1], ylim=[0.4, 0.8],
xlabel='Time (s)', ylabel='Decoding Accuracy', figsize=[6.4, 3.6], x0=0, ticksize=12,
fontsize=16, markersize=2, title=None, title_fontsize=16, avgshow=False):
xlabel='Time (s)', ylabel='Decoding Accuracy', figsize=[6.4, 3.6], x0=0, labelpad=0,
ticksize=12, fontsize=16, markersize=2, title=None, title_fontsize=16, avgshow=False):

"""
Plot the time-by-time decoding accuracies
Expand Down Expand Up @@ -579,6 +584,8 @@ def plot_tbyt_decoding_acc(acc, start_time=0, end_time=1, time_interval=0.01, ch
The size of the figure.
x0 : float. Default is 0.
The Y-axis is at x=x0.
labelpad : int or float. Default is 0.
Distance of ylabel from the y-axis.
ticksize : int or float. Default is 12.
The size of the ticks.
fontsize : int or float. Default is 16.
Expand Down Expand Up @@ -677,7 +684,7 @@ def plot_tbyt_decoding_acc(acc, start_time=0, end_time=1, time_interval=0.01, ch
plt.xlim(xlim[0], xlim[1])
plt.tick_params(labelsize=ticksize)
plt.xlabel(xlabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize, labelpad=labelpad)

plt.title(title, fontsize=title_fontsize)
plt.show()
Expand All @@ -689,8 +696,9 @@ def plot_tbyt_decoding_acc(acc, start_time=0, end_time=1, time_interval=0.01, ch
def plot_tbyt_diff_decoding_acc(acc1, acc2, start_time=0, end_time=1, time_interval=0.01, chance=0.5, p=0.05, cbpt=True,
clusterp=0.05, stats_time=[0, 1], color1='r', color2='b', label1='Condition1',
label2='Condition2', xlim=[0, 1], ylim=[0.4, 0.8], xlabel='Time (s)',
ylabel='Decoding Accuracy', figsize=[6.4, 3.6], x0=0, ticksize=12, fontsize=16,
markersize=2, legend_fontsize=14, title=None, title_fontsize=16, avgshow=False):
ylabel='Decoding Accuracy', figsize=[6.4, 3.6], x0=0, labelpad=0, ticksize=12,
fontsize=16, markersize=2, legend_fontsize=14, title=None, title_fontsize=16,
avgshow=False):

"""
Plot the differences of time-by-time decoding accuracies between two conditions
Expand Down Expand Up @@ -741,6 +749,8 @@ def plot_tbyt_diff_decoding_acc(acc1, acc2, start_time=0, end_time=1, time_inter
The size of the figure.
x0 : float. Default is 0.
The Y-axis is at x=x0.
labelpad : int or float. Default is 0.
Distance of ylabel from the y-axis.
ticksize : int or float. Default is 12.
The size of the ticks.
fontsize : int or float. Default is 16.
Expand Down Expand Up @@ -912,7 +922,7 @@ def plot_tbyt_diff_decoding_acc(acc1, acc2, start_time=0, end_time=1, time_inter
plt.xlim(xlim[0], xlim[1])
plt.tick_params(labelsize=ticksize)
plt.xlabel(xlabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize, labelpad=labelpad)
plt.legend()
ax = plt.gca()
leg = ax.get_legend()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='neurora',
version='1.1.6.11',
version='1.1.6.12',
description=(
'A Python Toolbox for Multimodal Neural Data Representation Analysis'
),
Expand Down

0 comments on commit f0c417b

Please sign in to comment.