简体   繁体   中英

Polar map from existing Cartesian coordinates and phi values in matplotlib

I am trying to plot a polar colour heat map for a set of coordinates (coor) and corresponding phi values. I have used the tripcolor function as follows:

plt.tripcolor(coor[:, 0], coor[:, 1], phi, shading=shading, cmap=cmap, edgecolor="face")
plt.show()

This is the result that I got: PlotMesh

Is there a way to make the outer grid circular?

I would try to create a triangulation from the coordinates:

import matplotlib.tri as tri
triang = tri.Triangulation(coor[:, 0], coor[:, 1])
plt.tripcolor(triang, phi, shading=shading, cmap=cmap, edgecolor="face")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM