“Agregar barra de color matplotlib” Código de respuesta

Agregue la barra de color a las gráficas de la línea de matlotlib de figura

import matplotlib.pyplot as plt
sm = plt.cm.ScalarMappable(cmap=my_cmap, norm=plt.normalize(min=0, max=1))
plt.colorbar(sm)
Fantastic Ferret

Agregar barra de color matplotlib


import numpy as np
import matplotlib.pyplot as plt

data = np.arange(100, 0, -1).reshape(10, 10)

fig, ax = plt.subplots()
cax = fig.add_axes([0.27, 0.8, 0.5, 0.05])

im = ax.imshow(data, cmap='gist_earth')
fig.colorbar(im, cax=cax, orientation='horizontal')
plt.show()

Repulsive Reindeer

Agregar barra de color matplotlib

import matplotlib.pyplot as plt

plt.figure()
m = create_map()
plt.scatter(*positions[::-1],c=count_vec)
plt.colorbar()
plt.show()
Perro Fiel

Respuestas similares a “Agregar barra de color matplotlib”

Preguntas similares a “Agregar barra de color matplotlib”

Más respuestas relacionadas con “Agregar barra de color matplotlib” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código