annainvestment.blogg.se

Scatter plot matplotlib dataframe
Scatter plot matplotlib dataframe






scatter plot matplotlib dataframe

Like this: df.plot(kind'scatter', x'MSFT', y'AAPL', figsize(9,6), color'Green') As we see in the plot above, the scatter plot shows the relationship between Microsoft and Apple stock prices. The coordinates of each point are defined by two dataframe columns and filled circles are used to represent each point. Scatter plots plot data points on the x and y axes to show the correlation between two variables. To fix this, we can use the matplotlib inline command before we create the line plot: matplotlib inline import matplotlib.pyplot as plt define x and y x 1, 6, 10 y 5, 13, 27 create scatter plot of x and y plt. Create a scatter plot with varying marker point size and color.

scatter plot matplotlib dataframe

#Scatter plot matplotlib dataframe code

yticks ( ) #plt. The code runs without any errors, but no line plot is displayed inline with the code. ylim ( 0.5, 4.5 ) # remove ticks and values of axis: plot ( 'x_values', 'y_values', data =df, linestyle = 'none', marker = '*' )Īll_poss = # to see all possibilities: # () # set the limit of x and y axis:








Scatter plot matplotlib dataframe