“Plt.Text Background Alpha” Réponses codées

PLT Text Matplotlib blanc fond

import numpy as np
import matplotlib.pyplot as plt
plt.figure()
ax = plt.subplot(111)
plt.plot(np.linspace(1,0,1000))
t = plt.text(0.03,.95,'text',transform=ax.transAxes,backgroundcolor='0.75',alpha=.5)
plt.show()
Perro Fiel

Plt.Text Background Alpha

plt_text = plt.text(
	0.5,  # x
    0.5,  # y
    'your text',  # text
    fontsize=30
)
plt_text.set_bbox(dict(
	facecolor='red',  # background color
    alpha=0.5,  # background alpha
    edgecolor='red'  # border color
))
Attractive Addax

Réponses similaires à “Plt.Text Background Alpha”

Questions similaires à “Plt.Text Background Alpha”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code