vaichidrewar vaichidrewar - 1 year ago 66
Python Question

how to make hollow square marks with matplotlib in python

Black line in the following graph is plotting using the below command for matplotlib python

pylab.semilogy(xaxis, pq_averages, 'ks-',color='black', label='DCTCP-PQ47.5')

So 'ks-' part indicates solid line with square black marks. So it had solid squares for the plotted points. Can these squares be made hollow instead?

enter image description here

Answer Source

Try adding markerfacecolor like so:

pylab.semilogy(xaxis, pq_averages, 'ks-', markerfacecolor='white', label='DCTCP-PQ47.5')