1

I have a dataset which has a different range of the x coordinate at each y coordinate, without a specific rule or a fixed delta_x. E.g.

  • y=0 -> x is 40 values in range(20, 55)
  • y=1 -> x is 40 values in range(24, 49)
  • y=2 -> x is 40 values in range(23, 59)
  • ...

Is there a way to get a checkerboard plot with such data using imshow?

I have tried changing the extent at each y value in a loop, but this just shifts each row to the last extent i set. In the plots below, the horizontal extent at the top should be [1410, 2190], and the horizontal extent at the bottom is [1453, 4970]. The red and white lines are a simple plot on top, and should follow the area shaded in red and yellow. See image here

I have tried using tricontourf (after Oliver W.'s suggestion here), which handles the dataset fine, the plot is accurate. You can also see how the horizontal extent changes. There are some artifacts in the image however. I'd like to use rectangles without interpolation, instead of interpolated triangles, if possible. See image here

I have tried appending the minimum and maximum values of all x at each y, and using those values for the horizontal extent, and it kinda works. See image here

It's still not accurate, and I'm not sure why. I can get a slightly better/more correct image by changing the values manually, first try. See image here

I'd be grateful for any comments or suggestions.

Anonymous
  • 26
  • 5

0 Answers0