Scatter Plots

class sage.plot.scatter_plot.ScatterPlot(xdata, ydata, options)

Bases: sage.plot.primitive.GraphicPrimitive

Scatter plot graphics primitive.

get_minmax_data()

Returns a dictionary with the bounding box data.

EXAMPLES:

sage: s = scatter_plot([[0,1],[2,4],[3.2,6]])
sage: d = s.get_minmax_data()
sage: d['xmin']
0.0
sage: d['ymin']
1.0
sage.plot.scatter_plot.scatter_plot(*args, **kwds)

Returns a Graphics object of a scatter plot containing all points in the datalist. Type code{scatter_plot.options} to see all available plotting options.

INPUT:

  • datalist – a list of tuples (x,y)
  • alpha – default: 1
  • markersize – default: 50
  • marker – default: 'o'
  • facecolor – default: '#fec7b8'
  • edgecolor – default: 'black'
  • zorder – default: 5

EXAMPLES:

sage: s = scatter_plot([[0,1],[2,2],[4.3,1.1]], marker='s')
sage: s

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)
sage: scatter_plot([(0, 0), (1, 1)], markersize=100, facecolor='green').show(ymax=100) # These are equivalent

Previous topic

Plotting primitives

Next topic

Text in plots

This Page