Rotation of ticks ( check the label at x axis )ĭf.plot.scatter(title='rot=180',x='visit',y='sale') « Pandas plot plot. We can specify log scaling or symlog scaling for x ( logx=True ) or log scaling for y ( logy=True ), we can specify both the axis by loglog ( loglog=True)ĭf.plot.scatter(loglog=True,x='visit',y='sale') rot We will show grid ( grid=True ) or not ( grid=False)ĭf.plot.scatter(title='grid=True',x='visit',y='sale',grid=True) logx logy loglog Here it is color=, this is in R G B format where each value varies from 0 to 1.ĭf.plot.scatter(title='Sale',x='visit',y='sale',color=) grid The code below produces a scatter plot with star shaped markers. We can use one tuple to define the colours. Just use the marker argument of the plot() function to custom the shape of the data points. We can use the option colors to give different colors to points. 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. Here width is 6 inches and height is 3 inches.ĭf.plot.scatter(figsize=(6,3),x='visit',y='sale') fontsize fontsize=20, we can set the font size used labels in x and y axis.ĭf.plot.scatter(x='visit',y='sale',fontsize=20) The code runs without any errors, but no line plot is displayed inline with the code. Size of the graph, it is a tuple saying width and height in inches, figsize=(6,3). Title : title='sale Vs Visit' String used as Title of the graph. There are several options we can add to above scatter diagram. to generate scatter graph using dataĭf.plot.scatter(title='Sale Vs Visit',x='visit',y='sale') scatter chart with options Pandas DataFrame Plot scatter graph « Pandas plot
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |