KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How do I set color to Rectangle for example in matplotlib? I tried using argument color, but had no success. I have following code: fig=pylab.figure() ax=fig.add_subplot(111) pylab.xlim([-400, 400]) pylab.ylim([-400, 400]) patches = [] polygon = Rectangle((-400, -400), 10, 10, color='y') patches.append(polygon) p = PatchCollection(patches, cmap=matplotlib.cm.jet) ax.add_collection(p) ax.xaxis.set_major_locator(MultipleLocator(20)) ax.yaxis.set_major_locator(MultipleLocator(20)) pylab.show()
Tags (comma-separated)
Save Edits
Cancel