Marker edge width¶. Update. Viewed 9k times 10. Demo the marker edge widths of matplotlib’s markers. According to documentation, s is marker size in points**2. Set the same marker size of all points import numpy as np import matplotlib.pyplot as plt x = [1,2,3,4,5] y=np.sin(x) plt.scatter(x,y,s=500,c='magenta') plt.title('Scatter plot of sinx') plt.xlabel('x') plt.ylabel('sinx') plt.xlim(0,6) plt.ylim(-2,2) plt.show() Sometimes we need to adjust the markers to have a different numerical value of marker size to: import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker Here's a test script from the above page. The two versions shown on the above mentioned site do not work: legend = ax.legend(frameon=True) for legend_handle in legend.legendHandles: legend_handle._legmarker.set_markersize(9) and. Choosing marker size in Matplotlib.
'. Commented: Wo Mazdas on 23 Jul 2019 Accepted Answer: Oleg Komarov. this works fine. 4. Setting a fixed size for points in legend. 4 ⋮ Vote. How can I increase the size of the marker in the legend.
I am doing a scatter plot with square marker in matplotlib like this one: . ax.legend(markerscale=6) The two solutions do however work when the marker is set to '. Ask Question Asked 6 years, 11 months ago. Adjusting marker sizes. 1. Active 6 years, 11 months ago. Haa, I found it. We often want to change the marker sizes so as to make them clearer to read from a slideshow. Ask Question Asked 5 years, 10 ... the marker size changed manually to be 6 points for both markers in the legend; As you can see, this utilizes hidden underscore properties (_legmarker) and is bug-ugly. It may break down at any update in matplotlib. The first link in Google for 'matplotlib figure size' is AdjustingImageSize (Google cache of the page).. Follow 6,962 views (last 30 days) john birt on 30 Apr 2011. Vote. Im trying to set the marker size on a plot but having no luck, heres my code. How do I change the marker size for a plot? I want to achieve something like this: Which means I have to adjust the marker size and the figure size/ratio in such a way that there are no white space between markers.