pandas - Python: (Seaborn?) heat map from irregular meshgrid -


lets have 2 given meshgrids (e.g. measured data):

  • grid_1 ranges x=(-10...10); y=(-10...10) step size of 1
  • grid_2 ranges x=(-30...-10) & x=(10...30); y=(-30...-10) & y=(10...30) step size of 5, has hole of size of grid_1
  • i have z-values ('dose') every pair of xi, yi both meshgrids , both datasets present tables 3 columns x, y, dose

i tried draw heat map representation of data using seaborn's heatmap() function:

dm1 = df1.pivot('y', 'x', 'dose') opts = {'cmap': 'ylgnbu_r'} ax = sns.heatmap(dm1, **opts) ax.invert_yaxis() plt.savefig('dosemap-test-smooth.pdf') 

dosemap-smooth

dm2 = df2.pivot('y', 'x', 'dose') ax = sns.heatmap(dm2, **opts) ax.invert_yaxis() plt.savefig('dosemap-test-coarse.pdf') 

dosemap-coarse

df = df1.append(df2) dm = df.pivot('y', 'x', 'dose') ax = sns.heatmap(dm2, **opts) ax.invert_yaxis() plt.savefig('dosemap-test-total.pdf') 

dosemap-total

drawing 2 meshgrids independent 1 works fine, drawing them breaks binning(?) of heatmap. question is: how can achieve draw heatmap(-like) representation of 'irregularly' distributed data using python? :)

thanks in advance help!


Popular posts from this blog

node.js - How do I prevent MongoDB replica set from querying the primary? -

Apache NiFi ExecuteScript: Groovy script to replace Json values via a mapping file -