How to plot an image with non-linear y-axis with Matplotlib using imshow?

前端 未结 4 816
猫巷女王i
猫巷女王i 2020-12-09 19:58

How can I plot an 2D array as an image with Matplotlib having the y scale relative to the power of two of the y value?

For instance the first row of my array will ha

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-09 20:29

    You can look at matplotlib.image.NonUniformImage. But that only assists with having nonuniform axis - I don't think you're going to be able to plot adaptively like you want to (I think each point in the image is always going to have the same area - so you are going to have to have the wider rows multiple times). Is there any reason you need to plot the full array? Obviously the full detail isn't going to show up in any plot - so I would suggest heavily downsampling the original matrix so you can copy rows as required to get the image without running out of memory.

提交回复
热议问题