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?
Render the string using mathtext. E.g “$r$” for marker showing the letter r. A list of (x, y) pairs used for Path vertices. The center of the marker is located at (0, 0) and the size is normalized, such that the created path is encapsulated inside the unit cell.
Lay out a grid in the current line style. Plot x and y using plot() method with marker="o", markeredgecolor="red", markerfacecolor="green". To display the figure, use show() method.
We can set the aspect ratio of a plot using the set_aspect() method to make it a square plot and axis() method can also be used to make a square plot with equal axes in Matplotlib.
Adjust the Transparency of Scatter PointsUtilize the alpha argument in our scatter method and pass in a numeric value between 0 and 1. A value of 0 will make the plots fully transparent and unable to view on a white background. A value of 1 is the default with non-transparent points.
Try adding markerfacecolor
like so:
pylab.semilogy(xaxis, pq_averages, 'ks-', markerfacecolor='none', label='DCTCP-PQ47.5')
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With