![]() scatter ( range ( 8 ), range ( 8 ), marker = xy4, s = s3 ** 2 * sizes, facecolor = 'orange' ) plt. scatter ( range ( 8 ), range ( 8 ), marker = x圓, s = s3 ** 2 * sizes, facecolor = 'red' ) ax. scatter ( range ( 8 ), range ( 8 ), marker = xy2, s = s2 ** 2 * sizes, facecolor = 'green' ) ax. The code below produces a scatter plot with star shaped markers. scatter ( range ( 8 ), range ( 8 ), marker = xy1, s = s1 ** 2 * sizes, facecolor = 'blue' ) ax. Just use the marker argument of the plot() function to custom the shape of the data points. array () # calculate the points of the first pie marker # these are just the origin (0, 0) + some (cos, sin) points on a circle x1 = np. Even we can also set the size of the marker. # Defining the ratios for radius of pie chart markers r1 = 0.2 # 20% r2 = r1 + 0.2 # 40% r3 = r2 + 0.4 # 80% # define some sizes of the scatter marker sizes = np. Increase marker size to make plot easier to read sizeoftablescaled 3s2 for s in sizeoftable plt.scatter(totalbill, tip, ssizeoftablescaled) plt.show() Not only does the tip increase when total bill increases, but serving more people leads to a bigger tip as well. So, if we want to change the style of the marker, we can change it through this parameter (marker). The function returns a plot with desired axes and other parameters. With ‘none’, No patch boundary will be drawn. With ‘face’, the edge color will always be same as face color.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |