python - create heatmap2d from txt file -


I have set 2D data (30a) as a set txt file.

  XY 2.50 135.89 2.50 140.92 2.50 157.53 2.50 114.61 2.50 119.53 2.50 154.14 2.50 136.48 2.51 176.85 2.51 147.19 2.51 115.59 2.51 144.57 2.51 148.34 2.51 136.73 2.51 118.89 2.51 145.73 2.51 131.43 2.51 118.17 2.51 149.68 2.51 132.33 < / Code> 

I plotted with Gnuplot as a scatter plot but I would like to represent a heatmap as a 2D or density distribution. I saw examples in MatPlotLib or R and they have already started with random data to generate all the images.

I tried those codes and got an error like this

hist, edges = histogad ([x, y], cans, range, honorary, weight)

Attribute: Error: The compartment's dimensions should be equal to the dimensions of the sample x. Script ending

Is there any way to open the TSTT file and plot this data in gnuplot, the matplob my scatter plot looks like this

I want to show this image Map of contour map or density with color code bar My X-X 2.5- At a distance of 3.5 and at the distance of 110-180 with the X-axis 30k data points are

you If you are ready to do everything in Python, then you can calculate the histogram and create a contour plot in a script:

  NP import as import matplotlib.pyplot plt # load Data M = N.P.LodeText ('DataFieldDate', Skippers = 1) # Count 2D Histogram bins_x = 100 bins_y = 100 H, xedges, yedges = np.histogram2d (m [:, 0], m [:, 1], [bn_x, bins_i]) # length and yes, each length is 101 - here we get the average # left of every bin x Right edges, average = N.P. mashgrid (excision [1:] + exgesus [: - 1] / 2, (yedges [1:] + yedges [: - 1]) / 2) #colt plt.contourf (x , Y, H, SEMP = 'Jet' using a "jet" colormap,) Plt.show () # or plt.savefig ('contours.pdf')  

I just created some test data made of 2 coconut and got the result:

2D Contour conspiracy from histogram


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -