Issue
I am looking for this kind of plot but I really don't know what it is called in English. (I am not a native English speaker.)
After searching, I only found this SO phase question but is not clear to me. Can someone direct me on how to start creating this plot or maybe tell me what the correct name is for it?
Solution
After searching with some of the links provided above, I found out that plotting polygons is what i need.
from matplotlib.patches import Polygon
import matplotlib.pyplot as plt
polygon1 = Polygon([(-26.7243,-14.7423), (-26.7243,-30.0000),
(-40.0000,-30.0000),(-40.0000,-28.0181)], color='#660066', label='Fe')
polygon2 = Polygon([(-18.1347,-0.4263), (-16.6048,1.6135), (-16.6048,-30.0000),
(-26.7243,-30.0000),(-26.7243,-14.7423),(-18.1347,-0.4263)], color='#b6fcd5',
label='Fe3O4')
polygon3 = Polygon([(-18.1347,-0.4263), (-26.7243,-14.7423),
(-40.0000,-28.0181),(-40.0000,-22.2917),(-18.1347,-0.4263)], color='#ff7f50',
label='FeS')
polygon4 = Polygon([(0.0000,-20.2615), (0.0000,-30.0000), (-16.6048,-30.0000),
(-16.6048,1.6135),(-16.5517,1.6865),(-6.0517,-0.9385),(0.0000,-3.9643)],
color='#ffb6c1', label='Fe2O3')
polygon5 = Polygon([(-14.2390,10.0000), (-14.5829,7.5927), (-16.5517,1.6865),
(-16.6048,1.6135),(-18.1347,-0.4263),(-40.0000,-22.2917),(-40.0000,10.0000)],
color='#c6e2ff', label='FeS2')
polygon6 = Polygon([(-6.0517,-0.9385), (-16.5517,1.6865), (-14.5829,7.5927),
(-6.0517,-0.9385)], color='#d3ffce', label='FeSO4')
polygon7 = Polygon([(0.0000,-3.9643), (-6.0517,-0.9385), (-14.5829,7.5927),
(-14.2390,10.0000),(0.0000,10.0000)], color='#8a2be2', label='Fe2(SO4)3')
fig, ax = plt.subplots(1,1)
ax.add_patch(polygon1)
ax.add_patch(polygon2)
ax.add_patch(polygon3)
ax.add_patch(polygon4)
ax.add_patch(polygon5)
ax.add_patch(polygon6)
ax.add_patch(polygon7)
plt.ylim(-30,10)
plt.xlim(-40,0)
plt.legend(loc='best')
plt.show()
I will add the annotations later. Thanks for your comments.
Answered By - Orlando
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.