Question: Change Y axis font size wit Scanpy
gravatar for Thorerges
4 weeks ago by
Thorerges10 wrote:

I would like to increase the font size of only the y axis ticks:, ["gene"], 'CellType',figsize=(4,10), dendrogram=False)

Using plt.rcParams.update({'ytick.labelsize': 50}) doesn’t work. Updating rcParams using:

matplotlib.rcParams.update({'font.size': 5})

changes fonts for the entire plot, but I am interested in just the Y axis.

Does anyone know how to do this?

scanpy rna-seq python • 108 views
ADD COMMENTlink modified 4 weeks ago by zorbax210 • written 4 weeks ago by Thorerges10

The same has been answered in this SO thread:

ADD REPLYlink written 4 weeks ago by Arup Ghosh2.7k
gravatar for zorbax
4 weeks ago by
zorbax210 wrote:

You can modify the ylabel and yticks size with matplotlib.pyplot for a specific plot, without the global options of matplotlib.

import matplotlib.pyplot as plt
plt.xlabel('This is my x text label', size = 30)
plt.ylabel('This is my y text label', size = 20)
plt.xticks(size = 20)
plt.yticks(size = 20)

I used this example from the Matplotlin documentation:

import numpy as np
import matplotlib.pyplot as plt


N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = (30 * np.random.rand(N))**2

plt.scatter(x, y, s=area, c=colors, alpha=0.5);

plt.xlabel('This is my X text label', size = 30);
plt.ylabel('This is my Y text label', size = 20);
plt.xticks(size = 20);
plt.yticks(size = 20);

#      # This is not necessary for Jupyter.
ADD COMMENTlink modified 4 weeks ago • written 4 weeks ago by zorbax210
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2070 users visited in the last hour