Hi all,
I really liked the snipped John wrote in a mail some time ago, so I
mock up a very simple example to set the alpha on a legend.

It seems interesting to have such an example, also in the gallery.

Since I don't have much time to dive into the sphinx example
generation and so, I just hand you the code, asking to include it.

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
#!/usr/bin/python
#
# Show how to add a translucent legend

# import pyplot module
import matplotlib.pyplot as plt

# draw 2 crossing lines
plt.plot([0,1], label='going up')
plt.plot([1,0], label='going down')

# add the legend in the middle of the plot
leg = plt.legend(fancybox=True, loc='center')
# set the alpha value of the legend: it will be translucent
leg.get_frame().set_alpha(0.5)

# show the plot
plt.show()
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to