In this scatter plot example, we change the marker color to red and opacity to 0.3 (bit lite).Īpart from this, you can use the markers argument to change the default marker shape. However, you can change the marker colors using the color argument and the opacity by the alpha argument. In all our previous examples, you can see the default color of blue. ![]() In this Python matplotlib scatter plot example, we used the xlable, ylabel, and title functions to show X-Axis, Y-Axis labels, and chart titles. We already mentioned in previous charts about labeling the charts. Sales_data = df.groupby('Order Date')].sum() import pandas as pdĭf = pd.read_excel('/Users/suresh/Downloads/Global_Superstore.xls') Next, we draw a scatter plot using Profit in X-Axis and Sales in Y-Axis. In this example, we read the CSV file and converted it into DataFarme. Plt.show() Python matplotlib pyplot Scatter Chart using CSV Here, we used Python randint function to generate 50 random integer values from 5 to 50 and 100 to 1000 for x and y. Next, we used the Python matplotlib pyplot function to draw a scatter plot of x against y. This is a simple scatter plot example where we declared two lists of random numeric values. Python matplotlib pyplot Scatter Plot Examples
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |