Skip to content Skip to sidebar Skip to footer

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-'

Solution 1:

Try adding markerfacecolor like so:

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

Solution 2:

Setting markerfacecolor='white' does not actually make them hollow, it makes them white. In order to make them hollow, you need to set markerfacecolor='none'. Additionally, you need to set markeredgecolor to the color you want. So:

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

Will do the job for you.

Post a Comment for "How To Make Hollow Square Marks With Matplotlib In Python"