Visualization for Results

neurora.rsa_plot module

a module for plotting the NeuroRA results

neurora.rsa_plot.plot_brainrsa_glass(img, threshold=None, type='r')

Plot the 2-D projection of the RSA-result

Parameters
  • img (string) – The file path of the .nii file of the RSA results.

  • threshold (None or int. Default is None.) – The threshold of the number of voxels used in correction. If threshold=n, only the similarity clusters consisting more than threshold voxels will be visible. If it is None, the threshold-correction will not work.

  • type (string 'r' or 't') – The type of result (r-values or t-values).

neurora.rsa_plot.plot_brainrsa_montage(img, threshold=None, slice=[6, 6, 6], background='/Users/zitonglu/opt/anaconda3/lib/python3.9/site-packages/neurora/template/ch2bet.nii.gz', type='r')

Plot the RSA-result by different cuts

Parameters
  • img (string) – The file path of the .nii file of the RSA results.

  • threshold (None or int. Default is None.) – The threshold of the number of voxels used in correction. If threshold=n, only the similarity clusters consisting more than threshold voxels will be visible. If it is None, the threshold-correction will not work.

  • slice (array) – The point where the cut is performed. If slice=[slice_x, slice_y, slice_z], slice_x, slice_y, slice_z represent the coordinates of each cut in the x, y, z direction. If slice=[[slice_x1, slice_x2], [slice_y1, slice_y2], [slice_z1, slice_z2]], slice_x1 & slice_x2 represent the coordinates of each cut in the x direction, slice_y1 & slice_y2 represent the coordinates of each cut in the y direction, slice_z1 & slice_z2 represent the coordinates of each cut in the z direction.

  • background (Niimg-like object or string. Default is stuff.get_bg_ch2bet()) – The background image that the RSA results will be plotted on top of.

  • type (string 'r' or 't') – The type of result (r-values or t-values).

neurora.rsa_plot.plot_brainrsa_regions(img, threshold=None, background='/Users/zitonglu/opt/anaconda3/lib/python3.9/site-packages/neurora/template/ch2.nii.gz', type='r')

Plot the RSA-result regions by 3 cuts (frontal, axial & lateral)

Parameters
  • img (string) – The file path of the .nii file of the RSA results.

  • threshold (None or int. Default is None.) – The threshold of the number of voxels used in correction. If threshold=n, only the similarity clusters consisting more than threshold voxels will be visible. If it is None, the threshold-correction will not work.

  • background (Niimg-like object or string. Default is stuff.get_bg_ch2()) – The background image that the RSA results will be plotted on top of.

  • type (string 'r' or 't') – The type of result (r-values or t-values).

neurora.rsa_plot.plot_brainrsa_rlts(img, threshold=None, slice=[6, 6, 6], background=None, type='r')

Plot the RSA-result by a set of images

Parameters
  • img (string) – The file path of the .nii file of the RSA results.

  • threshold (None or int. Default is None.) – The threshold of the number of voxels used in correction. If threshold=n, only the similarity clusters consisting more than threshold voxels will be visible. If it is None, the threshold-correction will not work.

  • background (Niimg-like object or string. Default is None.) – The background image that the RSA results will be plotted on top of.

  • type (string 'r' or 't') – The type of result (r-values or t-values).

neurora.rsa_plot.plot_brainrsa_surface(img, threshold=None, type='r')

Plot the RSA-result into a brain surface

Parameters
  • img (string) – The file path of the .nii file of the RSA results.

  • threshold (None or int. Default is None.) – The threshold of the number of voxels used in correction. If threshold=n, only the similarity clusters consisting more than threshold voxels will be visible. If it is None, the threshold-correction will not work.

  • type (string 'r' or 't') – The type of result (r-values or t-values).

neurora.rsa_plot.plot_corrs_by_time(corrs, labels=None, time_unit=[0, 0.1], title=None, title_fontsize=16)

plot the correlation coefficients by time sequence

corrsarray

The correlation coefficients time-by-time. The shape of corrs must be [n, ts, 2] or [n, ts]. n represents the number of curves of the correlation coefficient by time sequence. ts represents the time-points. If shape of corrs is [n, ts 2], each time-point of each correlation coefficient curve contains a r-value and a p-value. If shape is [n, ts], only r-values.

labelstring-array or string-list or None. Default is None.

The label for each corrs curve. If label=None, no legend in the figure.

time_unitarray or list [start_t, t_step]. Default is [0, 0.1]

The time information of corrs for plotting start_t represents the start time and t_step represents the time between two adjacent time-points. Default time_unit=[0, 0.1], which means the start time of corrs is 0 sec and the time step is 0.1 sec.

titlestring-array. Default is None.

The title of the figure.

title_fontsizeint or float. Default is 16.

The fontsize of the title.

neurora.rsa_plot.plot_corrs_hotmap(corrs, chllabels=None, time_unit=[0, 0.1], lim=[0, 1], smooth=False, figsize=None, cmap=None, title=None, title_fontsize=16)

plot the hotmap of correlation coefficients for channels/regions by time sequence

corrsarray

The correlation coefficients time-by-time. The shape of corrs must be [n_chls, ts, 2] or [n_chls, ts]. n_chls represents the number of channels or regions. ts represents the number of time-points. If shape of corrs is [n_chls, ts 2], each time-point of each channel/region contains a r-value and a p-value. If shape is [n_chls, ts], only r-values.

chllabelstring-array or string-list or None. Default is None.

The label for channels/regions. If label=None, the labels will be ‘1st’, ‘2nd’, ‘3th’, ‘4th’, … automatically.

time_unitarray or list [start_t, t_step]. Default is [0, 0.1]

The time information of corrs for plotting start_t represents the start time and t_step represents the time between two adjacent time-points. Default time_unit=[0, 0.1], which means the start time of corrs is 0 sec and the time step is 0.1 sec.

limarray or list [min, max]. Default is [0, 1].

The corrs view lims.

smoothbool True or False. Default is False.

Smooth the results or not.

figsizearray or list, [size_X, size_Y]

The size of the figure. If figsize=None, the size of the figure will be ajusted automatically.

cmapmatplotlib colormap or None. Default is None.

The colormap for the figure. If cmap=None, the ccolormap will be ‘inferno’.

titlestring-array. Default is None.

The title of the figure.

title_fontsizeint or float. Default is 16.

The fontsize of the title.

neurora.rsa_plot.plot_corrs_hotmap_withstats(corrs, chllabels=None, time_unit=[0, 0.1], lim=[0, 1], p=0.05, cbpt=False, clusterp=0.05, stats_time=[0, 1], smooth=False, xlabel='Time (s)', ylabel='Channel', clabel='Similarity', ticksize=18, figsize=None, cmap=None, title=None, title_fontsize=16)

plot the hotmap of correlation coefficients for channels/regions by time sequence with the significant outline

corrsarray

The correlation coefficients time-by-time. The shape of corrs must be [n_subs, n_chls, ts, 2] or [n_subs, n_chls, ts]. n_subs represents the number of subjects. n_chls represents the number of channels or regions. ts represents the number of time-points. If shape of corrs is [n_chls, ts 2], each time-point of each channel/region contains a r-value and a p-value. If shape is [n_chls, ts], only r-values.

chllabelsstring-array or string-list or None. Default is None.

The label for channels/regions. If label=None, the labels will be ‘1st’, ‘2nd’, ‘3th’, ‘4th’, … automatically.

time_unitarray or list [start_t, t_step]. Default is [0, 0.1]

The time information of corrs for plotting start_t represents the start time and t_step represents the time between two adjacent time-points. Default time_unit=[0, 0.1], which means the start time of corrs is 0 sec and the time step is 0.1 sec.

limarray or list [min, max]. Default is [0, 1].

The corrs view lims.

p: float. Default is 0.05.

The p threshold for outline.

cbptbool True or False. Default is True.

Conduct cluster-based permutation test or not.

clusterpfloat. Default is 0.05.

The threshold of cluster-defining p-values.

stats_timearray or list [stats_time1, stats_time2]. Default os [0, 1].

The time period for statistical analysis.

smoothbool True or False. Default is False.

Smooth the results or not.

xlabelstring. Default is ‘Time (s)’.

The label of x-axis.

ylabelstring. Default is ‘Channel’.

The label of y-axis.

clabelstring. Default is ‘Similarity’.

The label of color-bar.

ticksizeint or float. Default is 18.

The size of the ticks.

figsizearray or list, [size_X, size_Y]

The size of the figure. If figsize=None, the size of the figure will be ajusted automatically.

cmapmatplotlib colormap or None. Default is None.

The colormap for the figure. If cmap=None, the colormap will be ‘inferno’.

titlestring-array. Default is None.

The title of the figure.

title_fontsizeint or float. Default is 16.

The fontsize of the title.

neurora.rsa_plot.plot_ct_decoding_acc(acc, start_timex=0, end_timex=1, start_timey=0, end_timey=1, time_intervalx=0.01, time_intervaly=0.01, chance=0.5, p=0.05, cbpt=True, clusterp=0.05, stats_timex=[0, 1], stats_timey=[0, 1], xlim=[0, 1], ylim=[0, 1], clim=[0.4, 0.8], xlabel='Training Time (s)', ylabel='Test Time (s)', clabel='Decoding Accuracy', figsize=[6.4, 4.8], cmap='viridis', ticksize=12, fontsize=16, title=None, title_fontsize=16)

Plot the cross-temporal decoding accuracies

Parameters
  • acc (array) – The decoding accuracies. The size of acc should be [n_subs, n_tsx, n_tsy]. n_subs, n_tsx and n_tsy represent the number of subjects, the number of training time-points and the number of test time-points.

  • start_timex (int or float. Default is 0.) – The training start time.

  • end_timex (int or float. Default is 1.) – The training end time.

  • start_timey (int or float. Default is 0.) – The test start time.

  • end_timey (int or float. Default is 1.) – The test end time.

  • time_intervalx (float. Default is 0.01.) – The training time interval between two time samples.

  • time_intervaly (float. Default is 0.01.) – The test time interval between two time samples.

  • chance (float. Default is 0.5.) – The chance level.

  • p (float. Default is 0.05.) – The threshold of p-values.

  • cbpt (bool True or False. Default is True.) – Conduct cluster-based permutation test or not.

  • clusterp (float. Default is 0.05.) – The threshold of cluster-defining p-values.

  • stats_timex (array or list [stats_timex1, stats_timex2]. Default os [0, 1].) – Trainning time period for statistical analysis.

  • stats_timey (array or list [stats_timey1, stats_timey2]. Default os [0, 1].) – Test time period for statistical analysis.

  • xlim (array or list [xmin, xmax]. Default is [0, 1].) – The x-axis (training time) view lims.

  • ylim (array or list [ymin, ymax]. Default is [0, 1].) – The y-axis (test time) view lims.

  • clim (array or list [cmin, cmax]. Default is [0.4, 0.8].) – The color-bar (decoding accuracy) view lims.

  • xlabel (string. Default is 'Training Time (s)'.) – The label of x-axis.

  • ylabel (string. Default is 'Test Time (s)'.) – The label of y-axis.

  • clabel (string. Default is 'Decoding Accuracy'.) – The label of color-bar.

  • figsize (array or list, [size_X, size_Y]. Default is [6.4, 3.6].) – The size of the figure.

  • cmap (matplotlib colormap or None. Default is None.) – The colormap for the figure.

  • ticksize (int or float. Default is 12.) – The size of the ticks.

  • fontsize (int or float. Default is 16.) – The fontsize of the labels.

  • title (string-array. Default is None.) – The title of the figure.

  • title_fontsize (int or float. Default is 16.) – The fontsize of the title.

neurora.rsa_plot.plot_ct_diff_decoding_acc(acc1, acc2, start_timex=0, end_timex=1, start_timey=0, end_timey=1, time_intervalx=0.01, time_intervaly=0.01, p=0.05, cbpt=True, clusterp=0.05, stats_timex=[0, 1], stats_timey=[0, 1], xlim=[0, 1], ylim=[0, 1], clim=[0.4, 0.8], xlabel='Training Time (s)', ylabel='Test Time (s)', clabel='Differences of Decoding Accuracies', figsize=[6.4, 4.8], cmap='viridis', ticksize=12, fontsize=16, title=None, title_fontsize=16)

Plot the differences of cross-temporal decoding accuracies between two conditions

Parameters
  • acc1 (array) – The decoding accuracies under condition1. The size of acc should be [n_subs, n_tsx, n_tsy]. n_subs, n_tsx and n_tsy represent the number of subjects, the number of training time-points and the number of test time-points.

  • acc2 (array) – The decoding accuracies under condition2. The size of acc should be [n_subs, n_tsx, n_tsy]. n_subs, n_tsx and n_tsy represent the number of subjects, the number of training time-points and the number of test time-points.

  • start_timex (int or float. Default is 0.) – The training start time.

  • end_timex (int or float. Default is 1.) – The training end time.

  • start_timey (int or float. Default is 0.) – The test start time.

  • end_timey (int or float. Default is 1.) – The test end time.

  • time_intervalx (float. Default is 0.01.) – The training time interval between two time samples.

  • time_intervaly (float. Default is 0.01.) – The test time interval between two time samples.

  • chance (float. Default is 0.5.) – The chance level.

  • p (float. Default is 0.05.) – The threshold of p-values.

  • cbpt (bool True or False. Default is True.) – Conduct cluster-based permutation test or not.

  • clusterp (float. Default is 0.05.) – The threshold of cluster-defining p-values.

  • stats_timex (array or list [stats_timex1, stats_timex2]. Default os [0, 1].) – Trainning time period for statistical analysis.

  • stats_timey (array or list [stats_timey1, stats_timey2]. Default os [0, 1].) – Test time period for statistical analysis.

  • xlim (array or list [xmin, xmax]. Default is [0, 1].) – The x-axis (training time) view lims.

  • ylim (array or list [ymin, ymax]. Default is [0, 1].) – The y-axis (test time) view lims.

  • clim (array or list [cmin, cmax]. Default is [0.4, 0.8].) – The color-bar (decoding accuracy) view lims.

  • xlabel (string. Default is 'Training Time (s)'.) – The label of x-axis.

  • ylabel (string. Default is 'Test Time (s)'.) – The label of y-axis.

  • clabel (string. Default is 'Differences of Decoding Accuracies'.) – The label of color-bar.

  • figsize (array or list, [size_X, size_Y]. Default is [6.4, 3.6].) – The size of the figure.

  • cmap (matplotlib colormap or None. Default is None.) – The colormap for the figure.

  • ticksize (int or float. Default is 12.) – The size of the ticks.

  • fontsize (int or float. Default is 16.) – The fontsize of the labels.

  • title (string-array. Default is None.) – The title of the figure.

  • title_fontsize (int or float. Default is 16.) – The fontsize of the title.

neurora.rsa_plot.plot_nps_hotmap(similarities, chllabels=None, time_unit=[0, 0.1], lim=[0, 1], abs=False, smooth=False, figsize=None, cmap=None, title=None, title_fontsize=16)

plot the hotmap of neural pattern similarities for channels/regions by time sequence

similaritiesarray

The neural pattern similarities time-by-time. The shape of similarities must be [n_chls, ts]. n_chls represents the number of channels or regions. ts represents the number of time-points.

chllabelstring-array or string-list or None. Default is None.

The label for channels/regions. If label=None, the labels will be ‘1st’, ‘2nd’, ‘3th’, ‘4th’, … automatically.

time_unitarray or list [start_t, t_step]. Default is [0, 0.1]

The time information of corrs for plotting start_t represents the start time and t_step represents the time between two adjacent time-points. Default time_unit=[0, 0.1], which means the start time of corrs is 0 sec and the time step is 0.1 sec.

limarray or list [min, max]. Default is [0, 1].

The corrs view lims.

absboolean True or False. Default is False.

Change the similarities into absolute values or not.

smoothboolean True or False. Default is False.

Smooth the results or not.

figsizearray or list, [size_X, size_Y]

The size of the figure. If figsize=None, the size of the figure will be ajusted automatically.

cmapmatplotlib colormap or None. Default is None.

The colormap for the figure. If cmap=None, the ccolormap will be ‘viridis’.

titlestring-array. Default is None.

The title of the figure.

title_fontsizeint or float. Default is 16.

The fontsize of the title.

neurora.rsa_plot.plot_rdm(rdm, percentile=False, rescale=False, lim=[0, 1], conditions=None, con_fontsize=12, cmap=None, title=None, title_fontsize=16)

Plot the RDM

Parameters
  • rdm (array or list [n_cons, n_cons]) – A representational dissimilarity matrix.

  • percentile (bool True or False. Default is False.) – Rescale the values in RDM or not by displaying the percentile.

  • rescale (bool True or False. Default is False.) – Rescale the values in RDM or not. Here, the maximum-minimum method is used to rescale the values except for the values on the diagnal.

  • lim (array or list [min, max]. Default is [0, 1].) – The corrs view lims.

  • conditions (string-array or string-list. Default is None.) – The labels of the conditions for plotting. conditions should contain n_cons strings, If conditions=None, the labels of conditions will be invisible.

  • con_fontsize (int or float. Default is 12.) – The fontsize of the labels of the conditions for plotting.

  • cmap (matplotlib colormap. Default is None.) – The colormap for RDM. If cmap=None, the ccolormap will be ‘jet’.

  • title (string-array. Default is None.) – The title of the figure.

  • title_fontsize (int or float. Default is 16.) – The fontsize of the title.

neurora.rsa_plot.plot_rdm_withvalue(rdm, lim=[0, 1], value_fontsize=10, conditions=None, con_fontsize=12, cmap=None, title=None, title_fontsize=16)

Plot the RDM with values

Parameters
  • rdm (array or list [n_cons, n_cons]) – A representational dissimilarity matrix.

  • lim (array or list [min, max]. Default is [0, 1].) – The corrs view lims.

  • value_fontsize (int or float. Default is 10.) – The fontsize of the values on the RDM.

  • conditions (string-array or string-list or None. Default is None.) – The labels of the conditions for plotting. conditions should contain n_cons strings, If conditions=None, the labels of conditions will be invisible.

  • con_fontsize (int or float. Default is 12.) – The fontsize of the labels of the conditions for plotting.

  • cmap (matplotlib colormap or None. Default is None.) – The colormap for RDM. If cmap=None, the ccolormap will be ‘Greens’.

  • title (string-array. Default is None.) – The title of the figure.

  • title_fontsize (int or float. Default is 16.) – The fontsize of the title.

neurora.rsa_plot.plot_t_hotmap_withstats(results, chllabels=None, time_unit=[0, 0.1], lim=[- 7, 7], p=0.05, cbpt=False, clusterp=0.05, stats_time=[0, 1], smooth=False, xlabel='Time (s)', ylabel='Channel', clabel='t', ticksize=18, figsize=None, cmap=None, title=None, title_fontsize=16)

plot the hotmap of statistical results for channels/regions by time sequence

resultsarray

The results. The shape of results must be [n_subs, n_chls, ts, 2] or [n_subs, n_chls, ts]. n_subs represents the number of subjects. n_chls represents the number of channels or regions. ts represents the number of time-points. If shape of corrs is [n_chls, ts 2], each time-point of each channel/region contains a r-value and a p-value. If shape is [n_chls, ts], only r-values.

chllabelsstring-array or string-list or None. Default is None.

The label for channels/regions. If label=None, the labels will be ‘1st’, ‘2nd’, ‘3th’, ‘4th’, … automatically.

time_unitarray or list [start_t, t_step]. Default is [0, 0.1]

The time information of corrs for plotting start_t represents the start time and t_step represents the time between two adjacent time-points. Default time_unit=[0, 0.1], which means the start time of corrs is 0 sec and the time step is 0.1 sec.

limarray or list [min, max]. Default is [0, 1].

The corrs view lims.

p: float. Default is 0.05.

The p threshold for outline.

cbptbool True or False. Default is True.

Conduct cluster-based permutation test or not.

clusterpfloat. Default is 0.05.

The threshold of cluster-defining p-values.

stats_timearray or list [stats_time1, stats_time2]. Default os [0, 1].

The time period for statistical analysis.

smoothbool True or False. Default is False.

Smooth the results or not.

xlabelstring. Default is ‘Time (s)’.

The label of x-axis.

ylabelstring. Default is ‘Channel’.

The label of y-axis.

clabelstring. Default is ‘Similarity’.

The label of color-bar.

ticksizeint or float. Default is 18.

The size of the ticks.

figsizearray or list, [size_X, size_Y]

The size of the figure. If figsize=None, the size of the figure will be ajusted automatically.

cmapmatplotlib colormap or None. Default is None.

The colormap for the figure. If cmap=None, the ccolormap will be ‘bwr’.

titlestring-array. Default is None.

The title of the figure.

title_fontsizeint or float. Default is 16.

The fontsize of the title.

neurora.rsa_plot.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)

Plot the time-by-time decoding accuracies

Parameters
  • acc (array) – The decoding accuracies. The size of acc should be [n_subs, n_ts]. n_subs, n_ts represent the number of subjects and number of time-points.

  • start_time (int or float. Default is 0.) – The start time.

  • end_time (int or float. Default is 1.) – The end time.

  • time_interval (float. Default is 0.01.) – The time interval between two time samples.

  • chance (float. Default is 0.5.) – The chance level.

  • p (float. Default is 0.05.) – The threshold of p-values.

  • cbpt (bool True or False. Default is True.) – Conduct cluster-based permutation test or not.

  • clusterp (float. Default is 0.05.) – The threshold of cluster-defining p-values.

  • stats_time (array or list [stats_time1, stats_time2]. Default os [0, 1].) – Time period for statistical analysis.

  • color (matplotlib color or None. Default is 'r'.) – The color for the curve.

  • xlim (array or list [xmin, xmax]. Default is [0, 1].) – The x-axis (time) view lims.

  • ylim (array or list [ymin, ymax]. Default is [0.4, 0.8].) – The y-axis (decoding accuracy) view lims.

  • xlabel (string. Default is 'Time (s)'.) – The label of x-axis.

  • ylabel (string. Default is 'Decoding Accuracy'.) – The label of y-axis.

  • figsize (array or list, [size_X, size_Y]. Default is [6.4, 3.6].) – The size of the figure.

  • x0 (float. Default is 0.) – The Y-axis is at x=x0.

  • ticksize (int or float. Default is 12.) – The size of the ticks.

  • fontsize (int or float. Default is 16.) – The fontsize of the labels.

  • markersize (int or float. Default is 2.) – The size of significant marker.

  • title (string-array. Default is None.) – The title of the figure.

  • title_fontsize (int or float. Default is 16.) – The fontsize of the title.

  • avgshow (boolen True or False. Default is False.) – Show the averaging decoding accuracies or not.

neurora.rsa_plot.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', 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)

Plot the differences of time-by-time decoding accuracies between two conditions

Parameters
  • acc1 (array) – The decoding accuracies under condition1. The size of acc1 should be [n_subs, n_ts]. n_subs, n_ts represent the number of subjects and number of time-points.

  • acc2 (array) – The decoding accuracies under condition2. The size of acc2 should be [n_subs, n_ts]. n_subs, n_ts represent the number of subjects and number of time-points.

  • start_time (int or float. Default is 0.) – The start time.

  • end_time (int or float. Default is 1.) – The end time.

  • time_interval (float. Default is 0.01.) – The time interval between two time samples.

  • chance (float. Default is 0.5.) – The chance level.

  • p (float. Default is 0.05.) – The threshold of p-values.

  • cbpt (bool True or False. Default is True.) – Conduct cluster-based permutation test or not.

  • clusterp (float. Default is 0.05.) – The threshold of cluster-defining p-values.

  • stats_time (array or list [stats_time1, stats_time2]. Default os [0, 1].) – Time period for statistical analysis.

  • color1 (matplotlib color or None. Default is 'r'.) – The color for the curve under condition1.

  • color2 (matplotlib color or None. Default is 'r'.) – The color for the curve under condition2.

  • xlim (array or list [xmin, xmax]. Default is [0, 1].) – The x-axis (time) view lims.

  • ylim (array or list [ymin, ymax]. Default is [0.4, 0.8].) – The y-axis (decoding accuracy) view lims.

  • xlabel (string. Default is 'Time (s)'.) – The label of x-axis.

  • ylabel (string. Default is 'Decoding Accuracy'.) – The label of y-axis.

  • figsize (array or list, [size_X, size_Y]. Default is [6.4, 3.6].) – The size of the figure.

  • x0 (float. Default is 0.) – The Y-axis is at x=x0.

  • ticksize (int or float. Default is 12.) – The size of the ticks.

  • fontsize (int or float. Default is 16.) – The fontsize of the labels.

  • markersize (int or float. Default is 2.) – The size of significant marker.

  • title (string-array. Default is None.) – The title of the figure.

  • title_fontsize (int or float. Default is 16.) – The fontsize of the title.

  • avgshow (boolen True or False. Default is False.) – Show the averaging decoding accuracies or not.

neurora.rsa_plot.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)

Plot the time-by-time Similarities with statistical results

Parameters
  • similarities (array) – The Similarities. The size of similarities should be [n_subs, n_ts] or [n_subs, n_ts, 2]. n_subs, n_ts represent the number of subjects and number of time-points. 2 represents the similarity and a p-value.

  • start_time (int or float. Default is 0.) – The start time.

  • end_time (int or float. Default is 1.) – The end time.

  • time_interval (float. Default is 0.01.) – The time interval between two time samples.

  • smooth (bool True or False. Default is True.) – Smooth the results or not.

  • chance (float. Default is 0.5.) – The chance level.

  • p (float. Default is 0.05.) – The threshold of p-values.

  • cbpt (bool True or False. Default is True.) – Conduct cluster-based permutation test or not.

  • clusterp (float. Default is 0.05.) – The threshold of cluster-defining p-values.

  • stats_time (array or list [stats_time1, stats_time2]. Default os [0, 1].) – Time period for statistical analysis.

  • color (matplotlib color or None. Default is 'r'.) – The color for the curve.

  • xlim (array or list [xmin, xmax]. Default is [0, 1].) – The x-axis (time) view lims.

  • ylim (array or list [ymin, ymax]. Default is [0.4, 0.8].) – The y-axis (decoding accuracy) view lims.

  • xlabel (string. Default is 'Time (s)'.) – The label of x-axis.

  • ylabel (string. Default is 'Representational Similarity'.) – The label of y-axis.

  • figsize (array or list, [size_X, size_Y]. Default is [6.4, 3.6].) – The size of the figure.

  • x0 (float. Default is 0.) – The Y-axis is at x=x0.

  • ticksize (int or float. Default is 12.) – The size of the ticks.

  • fontsize (int or float. Default is 16.) – The fontsize of the labels.

  • markersize (int or float. Default is 2.) – The size of significant marker.

  • title (string-array. Default is None.) – The title of the figure.

  • title_fontsize (int or float. Default is 16.) – The fontsize of the title.

  • avgshow (boolen True or False. Default is False.) – Show the averaging decoding accuracies or not.