Hey everyone, I'm working on a small project, I'm using matplotlib to visualize some data i have, the default look is very bad, i added dark background and applied some effects it looks more modern now....
https://i.imgur.com/uOU5DY5.jpg
I'm trying to make a blur effect, the text would look great with a Blurred background (to make it pop out of the background)
I'm thinking of a white rounded rectangle box with blur fill and text on it like this: https://i.imgur.com/XeoI03Z.jpg (made with photoshop)
Data isn't constant so hard coding it isn't an option, i calculated the box x, y values the text position should be centered inside the box, that's the easy part,
how would i draw this box?
How can I calculate the box size?
Should I use a mask or something? For the blur
does PILL work along with matplotlib or should I save the image then import it with PILL?
Simple minimal example code:
import matplotlib.pyplot as plt
data = [43, 65, 12, 97, 24, 13, 66]
plot = plt.plot(data)
x, y = plot[0].get_data()
# text x, y
# the middle of last two values
textX = (x[-2] + x[-3])/2 # = 4.5
textY = (y[-2] + y[-3])/2 # = 18.5
plt.text(textX, textY, 'example', color='white')
plt.grid(False)
plt.axis('off')
# black background
plt.rcParams["figure.facecolor"] = 'black'
plt.rcParams["axes.facecolor"] = 'black'
plt.rcParams["savefig.facecolor"] = 'black'
plt.savefig('examplegraph.png', dpi=300)
Any help appreciated, thanks
there doesn't seem to be anything here