1

I have made a scatterplot with squares.

But I would very much like to customise the sizes of each square. It should be so I could decide both length and height of each of the squares. Also if it is possible I would like to be able to customise different lengths of the square on each side of the dot-coordinate. My goal is that all the squares touches each other but some of the squares are supposed to have a bigger length and some a smaller than other.

My code is now like this:

data = pd.read_excel(r'data_prøve.xlsx', header = 0, usecols = [3,4,5,6])

#Definerer data for x og y
x = np.array(data['bredde']) 
y = np.array(data['højde'])
z = np.array(data['flux'])

plt.scatter(x,y)
plt.plot
plt.ylim(np.min(y)-3,np.max(y)+3)
plt.xlim(0, 9)
plt.xlabel(r"Meter i bredden", fontsize = 10)
plt.ylabel(r'Meter i dybden', fontsize = 10)

sc = plt.scatter(x, y, c=z, s=300 , marker='s', alpha =0.5, vmin=np.min(z), vmax=np.max(z)+10000) 

plt.colorbar(sc)
plt.show(),

and my plot look like this

plot with squares over the coordinates

Does anyone know how to do that? :-)

I work in Python

ther0761
  • 11
  • 3

0 Answers0