This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A simple function that uses python3 and matplotlib, and creates a plain colored circle (transparent png image 500x500 px). | |
# Inputs are the color_list and and the name of the file. | |
# The color_list can include multiple colors. A single color create a circle with that color. | |
# Multiple colors create a circle divided equally by the sum of the colors | |
# my_dpi variable is needed in order to make matplotlib to print an image with a specific size (usually dpi=96). | |
# More on this SO post: https://stackoverflow.com/questions/13714454/specifying-and-saving-a-figure-with-exact-size-in-pixels | |
# | |
# here we are ploting a 500x500 image | |
# you can find your dpi by going here: https://www.infobyip.com/detectmonitordpi.php |