Scatter plots¶
- class sage.plot.scatter_plot.ScatterPlot(xdata, ydata, options)[source]¶
Bases:
GraphicPrimitiveScatter plot graphics primitive.
Input consists of two lists/arrays of the same length, whose values give the horizontal and vertical coordinates of each point in the scatter plot. Options may be passed in dictionary format.
EXAMPLES:
sage: from sage.plot.scatter_plot import ScatterPlot sage: ScatterPlot([0,1,2], [3.5,2,5.1], {'facecolor':'white', 'marker':'s'}) Scatter plot graphics primitive on 3 data points
- sage.plot.scatter_plot.scatter_plot(datalist, alpha=1, markersize=50, marker='o', zorder=5, facecolor='#fec7b8', edgecolor='black', clip=True, aspect_ratio='automatic', **options)[source]¶
Return a Graphics object of a scatter plot containing all points in the datalist. Type
scatter_plot.optionsto see all available plotting options.INPUT:
datalist– list of tuples(x,y)alpha– (default: 1)markersize– (default: 50)marker– the style of the markers (default:'o'); see the documentation ofplot()for the full list of markersfacecolor– (default:'#fec7b8')edgecolor– (default:'black')zorder– (default: 5)
EXAMPLES:
sage: scatter_plot([[0,1],[2,2],[4.3,1.1]], marker='s') Graphics object consisting of 1 graphics primitive
Extra options will get passed on to
show(), as long as they are valid:sage: scatter_plot([(0, 0), (1, 1)], markersize=100, facecolor='green', ymax=100) Graphics object consisting of 1 graphics primitive sage: scatter_plot([(0, 0), (1, 1)], markersize=100, facecolor='green').show(ymax=100) # These are equivalent