“Etiquetas de tick vertical matplotlib” Código de respuesta

Rotación de la etiqueta matplotlib x

plt.xticks(rotation=45)
Exuberant Eel

girar xticks matplotlib

# rotate xticks of a plot Matplotlib
angle = 90
plt.xticks(rotation=angle)
Poised Pygmy

Etiquetas de tick vertical matplotlib

import matplotlib.pyplot as plt

x = range(6)
y = [-3, -2, -1, 1, 2, 3]
xlabels = [f'label {i}' for i in x]

fig, ax = plt.subplots()
ax.bar(x, y)

# ha='***' is not enough to visually align labels with ticks 
# use both ha='***' and rotation_mode='anchor'
ax.set_xticks(x, xlabels, rotation=45, ha='right', rotation_mode='anchor')

plt.show()
Arthur Elskens

Respuestas similares a “Etiquetas de tick vertical matplotlib”

Preguntas similares a “Etiquetas de tick vertical matplotlib”

Más respuestas relacionadas con “Etiquetas de tick vertical matplotlib” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código