Showing Z Value As An Annotation When Z Value Is >0.85 Tripcolor Matplotlib
I have problem similar to tripcolor demo example. I have lon,lat , z values which i am plotting using Tripcolor i want to show annotation as lon value,lat value and z value at par
Solution 1:
Voila, but in my opinion, you are trying to annotate way too much.
Adding the following snippet, yields the image below:
indices, = np.where(zfaces > 0.8)
for idx in indices:
xx, yy, zz = xmid[idx], ymid[idx], zfaces[idx]
ax3.annotate(f'x={xx:.2f}\ny={yy:.2f}\nz={zz:.2f}', (xx, yy),
horizontalalignment='center',
verticalalignment='center',
fontsize='xx-small',
color='black')
Here is a slightly better option:
indices, = np.where(zfaces > 0.8)
for idx in indices:
xx, yy, zz = xmid[idx], ymid[idx], zfaces[idx]
ax3.annotate(f'{zz:.2f}', (xx, yy),
horizontalalignment='center',
verticalalignment='center',
fontsize='xx-small',
color='white')
Post a Comment for "Showing Z Value As An Annotation When Z Value Is >0.85 Tripcolor Matplotlib"