Dear all,

I want to plot 3 overlapping regions using fill() into one panel, but my
solution looks sort of messy... Here is the code:

===
import matplotlib.pyplot as plt
import scipy

##Data to plot
seq = scipy.sin(range(0,10))
xpts = scipy.concatenate((range(0,10), range(0,10)[::-1]))
plt.figure()
##Plot 3 overlapping regions, a different color for each one
for diff, color in zip([1,2,3], ["blue", "red", "yellow"]):
    ypts = scipy.concatenate((seq - diff, (seq - diff * 2)[::-1]))
    plt.fill(xpts, ypts, alpha=0.4, fc=color, ec="black", lw=2,
label=str(diff))
plt.legend()
plt.show()
===

The figure looks like 4 regions are plotted, because overlapping red and
yellow make an orange region... I tried some different combination, but
it never looked good. Does anybody have an idea how to chose the colors
and 'alpha' values for transparency so that the plot looks good and
could be printed?

Any help is appreciated,
thanks in advance,
Hannes




------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to