- Create an image file from your plot and then "photoshop" it (or gimp it...)
- Add the alpha channel directly in the plotting tool...
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-JYZ16qOzzu0KDGPJG_dl4k1dbXbtQ_f_ksHTCmiucoIqQ5XsQW-D4BmJfUiUrOFvNd2KhYKoE2gZg5ZnxlMWRST07th1cLW6t0gwBtoCwDdASn_iINRh4EIw2SlE38sNVnO1fwilayN4/s320/origplotpng.png)
from pylab import * t = linspace(-2*pi,2*pi) y1=cos(t); y2=sin(t); plot(t,y1,label='Cosine') plot(t,y2,label='Sine') xlabel('Time') ylabel('y')
axis([-2*pi,2*pi,-1,1])
leg=legend()
savefig('namehere.png')
close()
Now we see from the resulting plot that the legend covers some of the graph. Now, before the "savefig" command, add the following:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3BDmG9CtdVt2AzWwJiwFTclh4CrHbRSBMS-mtenF4ioD_2BehYYpHTZw6FNuEDKEs5e0dpJdf244OXEVm9AuH9qm0VRVzRPwDgxsN-zLT8iHfJltkune29C849AdayaKigN13Bq1pXbPQ/s320/alphaplotpng.png)
frame=leg.get_frame()
frame.set_alpha(0.4)
The resulting plot is shown below the original. Better, don't you think? :-)
PS! Click on the plots to show larger versions!
ReplyDeleteNice blog. Thanks for sharing such great information.Develop xamarin application Hire xamarin developer