0

I am trying to render geophysics section with contourf map in matplotlib. I almost get desired result with only one exception, it renders from the bottom left corner. Rendered geophysics section

As it is section from surface, so 0 is a surface level, and 2000 is depth in nanoseconds. That means this contourf map needs to be rendered from top left corner.

CS = plt.contourf(x, y, amplitude, 25, cmap='jet', vmin=0, vmax=127)

I think i understanding the problem. My data is readed from binary file, where every shot is a list of values from surface to deepest value in every given point. So my 2D array is like:

1st shot [[65, 29, 56, 98, 82, 14,...],
2nd shot  [24, 54, 48, 41, 74, 37,...],
3rd shot  [34, 12, 18, 44, 87, 64,...]]
N shot....

Is there a way to reshape it like:

[[65, 24, 34],
 [29, 54, 12],
 [56, 48, 18],
 [98, 41, 44],
 [82, 74, 87],
 [14, 37, 64]]

This way if y invert y values (to be negatives) i could get desired result - 0 in upper left corner.

I know how to do is in plain python, but is there an efficient way in numpy?

Geolimber
  • 113
  • 1
  • 7

1 Answers1

1

If the data D is a numpy 2D array,

D = D.T

a simple transpose will achieve that.

Newcomer
  • 73
  • 7