From e1ee877942052f6130200b0aa66a3199a0456043 Mon Sep 17 00:00:00 2001 From: Blaise Li <blaise.li__git@nsup.org> Date: Fri, 22 Feb 2019 15:09:33 +0100 Subject: [PATCH] Trying to fix plot labels. --- PRO-seq/PRO-seq.snakefile | 12 ++++++------ small_RNA-seq/small_RNA-seq.snakefile | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PRO-seq/PRO-seq.snakefile b/PRO-seq/PRO-seq.snakefile index c1d5030..da3d2f7 100644 --- a/PRO-seq/PRO-seq.snakefile +++ b/PRO-seq/PRO-seq.snakefile @@ -1312,16 +1312,16 @@ rule make_MA_plot: else: grouping = params.id_list group2colour = (wildcards.id_list, sns.xkcd_rgb["orange"]) + title = f"MA-plot for {wildcards.contrast}, {wildcards.orientation}_{wildcards.biotype}" + if mpl.rcParams.get("text.usetex", False): + title = texscape(title) save_plot( output.MA_plot, plot_MA, res, grouping=grouping, group2colour=group2colour, - lfc_range = params.lfc_range, - fold_type = "log2FoldChange", - title="MA-plot for %s, %s_%s" % ( - wildcards.contrast, - wildcards.orientation, - wildcards.biotype)) + lfc_range=params.lfc_range, + fold_type="log2FoldChange", + title=title) ################## diff --git a/small_RNA-seq/small_RNA-seq.snakefile b/small_RNA-seq/small_RNA-seq.snakefile index e532bf4..067ca56 100644 --- a/small_RNA-seq/small_RNA-seq.snakefile +++ b/small_RNA-seq/small_RNA-seq.snakefile @@ -4164,7 +4164,7 @@ def plot_logo(data, ylabel): letter2legend = dict(zip("ACGTN", "ACGTN")) usetex = mpl.rcParams.get("text.usetex", False) if usetex: - ylabel = sub("_", r"\_", ylabel) + ylabel = texscape(ylabel) for (read_len, rel_heights) in data.mul(information, axis=0).iterrows(): y_base = 0 for (letter, rel_height) in rel_heights.sort_values().iteritems(): -- GitLab