diff --git a/libhts/libhts.py b/libhts/libhts.py index edce5a927303e7499e4a456b3f1c3a8e166bc858..24b9e20b65cc903acc951648b34a74bd37ee2060 100644 --- a/libhts/libhts.py +++ b/libhts/libhts.py @@ -473,7 +473,7 @@ def plot_scatter(data, x=x_column, y=y_column, s=1, c=group2colour[status], label=f"{status} ({len(group)})", ax=ax) else: - # Apply a coulour to a list of genes + # Apply a colour to a list of genes (status, colour) = group2colour row_indices = data.index.intersection(grouping) try: @@ -507,11 +507,15 @@ def plot_scatter(data, ax.set_ylim(y_range) return ax -def plot_paired_scatters(data, columns=None, hue=None): +def plot_paired_scatters(data, columns=None, hue=None, log_log=False): """Alternative to pairplot, in order to avoid histograms on the diagonal.""" if columns is None: columns = data.columns g = sns.PairGrid(data, vars=columns, hue=hue, size=8) #g.map_offdiag(plt.scatter, marker=".") g.map_lower(plt.scatter, marker=".") + if log_log: + for ax in g.axes.ravel(): + ax.set_xscale('log') + ax.set_yscale('log') g.add_legend()