0

I used python's matplotlib to plot my data. I call the numpy array before plotting as Array1 and it looks like this:

Array1.

After I called plt.pcolormesh(t,f,Array1), it produced an Image that looks like this:

Image.

Then I read the image by calling imread('Image'). I got Array2 that looks like this:

Array2.

I'm confused by these two arrays, and I'm wondering how did plt.pcolormesh mapped Array1 to Array2 so I can reverse the process and get my Array1 back from Array2.

sensationti
  • 195
  • 1
  • 9
  • Does this answer your question? [How to reverse a color map image to scalar values?](https://stackoverflow.com/questions/3720840/how-to-reverse-a-color-map-image-to-scalar-values) – JohanC May 03 '20 at 10:44
  • @JohanC Thank you for the response but this didn't really answer my question. I will modify my question. – sensationti May 05 '20 at 07:51
  • Well, you lose a lot of information when mapping to only 256 colors. A perfect inverse will not be possible, as explained in the suggested answer. (Probably the imaginary part is completely left out). The values in Array2 are just RGB color values (with an alpha of 1 added). – JohanC May 05 '20 at 08:44

0 Answers0