Plot value in range determined by MultiIndex

  excel, matplotlib, pandas, python

I am importing some data from excel using pd.read_excel(..., colum_index=[0,1]) to get a range where the values are valid

eg:

1 2 3
19.5 20 4.3 4.6 4.8
20 21.5 4.5 4.5 4.6

The first 2 colums basically determine the range where the values in the data colums (A to C) are valid.

I am currenty struggling to plot it like this.

plt.axis([1, 80, 14, 32])
plt.imshow(df,cmap=colors,extent=[xmin, xmax, ymin, ymax],vmin=2.0,vmax=6.3,origin="lower",aspect=xaspect, interpolation='none')

This unfortunatly does not plot the values at the correct positions. The boxes are the wrong size and wrong position.

Source: Python Questions

LEAVE A COMMENT