In [1]:
import numpy
from matplotlib import pyplot
%matplotlib inline
### generate some random data
xdata = numpy.arange(15)
ydata = numpy.random.randn(15) + xdata
### initialize the "figure" and "axes" objects
fig, ax = pyplot.subplots()
points_plot = ax.plot(xdata, ydata, marker='o')
Ok you got me, the plot
function still generates a line by default... but we can turn it off
In [2]:
### initialize the figure
fig, ax = pyplot.subplots()
points_plot = ax.plot(xdata, ydata, ls='', marker='o')
In [3]:
### initialize the figure
fig, ax = pyplot.subplots()
points_plot = ax.plot(xdata, ydata, ls='', marker='o', ms=15)
In [4]:
### initialize the figure
fig, ax = pyplot.subplots()
points_plot = ax.plot(xdata, ydata, ls='', ms=8, marker='o')
#points_plot = ax.plot(xdata, ydata, ls='', ms=8, marker='s')
#points_plot = ax.plot(xdata, ydata, ls='', ms=8, marker='D')
#points_plot = ax.plot(xdata, ydata, ls='', ms=8, marker='^')
#points_plot = ax.plot(xdata, ydata, ls='', ms=8, marker='>')
#points_plot = ax.plot(xdata, ydata, ls='', ms=8, marker='<')
#points_plot = ax.plot(xdata, ydata, ls='', ms=8, marker='v')
In [5]:
### generate some random data
xdata2 = numpy.arange(15)
ydata2 = numpy.random.randn(15)
yerrors = numpy.random.randn(15)
### initialize the figure
fig, ax = pyplot.subplots()
ax.errorbar(xdata2, ydata2, yerr=yerrors)
Out[5]:
In [6]:
### initialize the figure
fig, ax = pyplot.subplots()
eb = ax.errorbar(xdata2, ydata2, yerr=yerrors, ls='', # no lines connecting points
marker='*', # circular plot symbols
ms=20, # marker size
mfc='r', # marker face color
mew=2, # marker edge width
mec='k', # marker edge color
elinewidth=2, # error line width
ecolor='gray', # error color
capsize=6) # error hat size
### also try mfc="none"
In [ ]:
pyplot.errorbar?
In [ ]: