pythonmatplotlibscatter

Men=mars and female=venus symbols in python


I wish to create a plot that uses venus (U+2640 ♀) symbol to represent females and mars (U+2642 ♂) symbol to represent males. If you have used these before, please share with me how to set them as markers in pylab.scatter().


Solution

  • from matplotlib import pyplot as plt
    
    plt.scatter(range(3), range(1,4), 200, marker=ur'$\u2640$')
    plt.scatter(range(3), range(2,5), 200, marker=ur'$\u2642$')
    

    enter image description here

    Here you find the complete list of available symbols.