Yusufali Oomar
Yusufali Oomar

Reputation: 1

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?

Upvotes: 0

Views: 125

Answers (1)

ronkov
ronkov

Reputation: 1583

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")

Upvotes: 1

Related Questions