Answers for "plt.text background alpha"

0

plt text matplotlib white background

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()
Posted by: Guest on December-14-2020
0

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
))
Posted by: Guest on December-28-2020

Python Answers by Framework

Browse Popular Code Answers by Language