![]() With the help of multiple plots, we also saw various ways to present our data which can be used in various combinations to get some great overviews regarding the data. In this article, we went through one of the most commonly used methods for data visualization in python. Scatter Plot With Edgecolors And Linewidths Conclusion Plt.scatter(x = number_of_ratings, y = ratings_value, s = sizes, c = colors, cmap = "Greens",Īlpha = 0.75, linewidths = 1, edgecolors = "Black") Here is an example of a colourmap: Img of ColorbarĬolors = np.asarray([1, 2, 5, 4, 6, 8, 6, 3, 5, The Matplotlib module has a number of available colourmaps.Ī colourmap is like a list of colours, where each colour has a value that ranges from 0 to 100. Each float value in our colours array represents different colour intensities to plot our data. ![]() Scatter Plot with Marker Parameter The colourmap parameterĬmap – A Colormap instance or registered colourmap name. cmap is only used if c is an array of floats, (default: ‘viridis’). Plt.scatter(x = number_of_ratings, y = ratings_value, s = sizes, c = "green", marker = "^" ) Sizes = np.asarray() Number_of_ratings = np.asarray() # Using a different marker: (default: 'o') Let’s try to make some plots and try to visualize the trend. We want find the rating trend from the viewers. Most commonly, NumPy arrays are used for the code to run more efficiently, shape (n, ), required.įor example – We have a dataset with the features, number_of_ratings for a video post on some social media, and we have a ratings_value which varies from 1 – 9. The x_axis_array_data & y_axis_array_dataĪll the parameters mentioned above are optional except the x_axis_array_data and y_axis_array_data, which, as their name suggests takes in two sets of values as an array. You can install matplotlib using the command:Īlternatively, you can install it using Anaconda. Modifying Scatter Plot Parameters To Create Visualizations With PyPlot Scatter
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |