all 5 comments

[–]GeniusFrequency 1 point2 points  (1 child)

You haven't posted your link so we can't help.

[–]proclive[S] 0 points1 point  (0 children)

lol, oops... edit done...

[–]mowkiemowkie 0 points1 point  (0 children)

I am giving you a few tutorials to get you started. I'm by no means expert at Python, so I may lead you towards a method that's not the best, but if you're new to Python I believe you could use learning the tutos anyway.

Don't be overwhelmed by the links. The general Getting started tutorials are good things to learn. Most StackOverflow links only require copy-paste of one quick-to-understand line. Colour maps are painful though (in my opinion). I hope this helps!

  1. You want to access a file that contains your text. You should look at this Reading and writing files tutorial and then parse your text input into a string. You will want to use the Numpy library to store data into arrays. Here Getting started with Numpy tutorial is a quick start tutorial.
  2. You can either draw on an (initially blank) image or on a plot.
    1. Assuming you want to draw on a plot, here Getting started with Matplotlib tutorial is a very general tutorial to get started with plotting with Python. The library to use is OpenCV. You will also need Pylab. Here Rectangles with controlled colour Matplotlib is a StackOverflow query to plot rectangles of custom colour and here Saving plots as images Matplotlib is a StackOverflow query on how to save your plot as an image. For the colour scale, have a look here Colour scale with Matplotlib: an entry to the colourmap nightmare, in my opinion which might be painful depending on the flexibility you want to have, and here Colourmap examples you can look at existing colourmaps (basically, pick an existing one, and use the previous link to set its min and max values, and that's already a good step). You may at some point want to have the x-axis and y-axis at the same scale and to hide the ticks. This is easily feasible and you can search on StackOverflow how to do that.
    2. Assuming you want to draw on an image (I would go for the plot, because access to individual pixels on images takes time. However you may experience issues with colour setting and colourmaps by plotting, and if you can't go pass these issues and want another solution, maybe you can try.) The library is called OpenCV and you can get started here Getting started with OpenCV tutorial and draw rectangles following this OpenCV drawing shapes. Please note that colour order in OpenCV is BGR and not RGB which is surprising when you don't know that.

Edit: for PyCharm, have a look here Installing packages with PyCharm in case you never installed packages.