My data set contains approximately thousands of values in four columns X, Y, Z, error of Z -
1.2351e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.2417e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.2483e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.2549e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.2615e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.2681e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.2746e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.2812e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.2878e+00 -6.3115e-02 1.8186e+01 1.8186e+01
1.2944e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.3010e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.3075e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.3141e+00 -6.3115e-02 0.0000e+00 0.0000e+00
1.3207e+00 -6.3115e-02 0.0000e+00 0.0000e+00
... ....
I want to plot these data using a contour plot, something like this-
(reference image)

I am using the following code -
import numpy as np
import matplotlib.pyplot as plt
x, y, z, err = np.genfromtxt(r'dataset_gid.txt', unpack=True)
x1, y1 = np.meshgrid(x, y)
cont1 = plt.tricontourf(x, y, z, cmap='seismic')
plt.colorbar(cont1)
plt.show()
I am getting the following plot -
How can I generate a colorbar similar to the above image? I have created a gist for the dataset I am using here.
Update
Using scat=plt.scatter(x, y, c=z, s=3);plt.colorbar(scat) gives me weird lines -
Using plt.tricontourf(x, y, z, levels=50) looks better but the spots are not bright enough.
Is there a way to make the spots brighter like the reference image?



A few preliminaries
read the data, find extremes
plot a scatter plot of all the data, the "weird lines", (OP comment) are just the data points, that are all placed on a regular grid, loose in x-direction and tight in y-direction.
Now, let;s plot a contour plot, with 3 levels
In my opinion, the contour plot is less informative than the scatter plot.
Finally, let's try a set of selective scatter plots, where we draw only the points whose z values are comprised in a different range for each subplot
In my opinion, this arrangement is the most informative.
The color scales are different in the different subplots, you can have the same scaling using
vmin=,vmax=but, again IMO, it's better with different scales.Array Shape Clarification
First, I looked at the factors of 64911
next I had a look into the data, the lines 1–77 have the same y value and different x values, the lines 78–154 have another, common y value and the same 77 x values of lines 1–77.
My conclusion was the data is given over a (7·11)×(3·281) = 77×843 x–y grid.
Re your data, a lot of error values are equal to z value reported in the previous column, is this what you expect from your measurements/simulations?