pyplot: Plot lines or markersusing pyplot.plot

Description Usage Arguments See Also Examples

Description

Plot 2D line plots and scatter plots using matplotlib.pyplot.plot. You can interact with the plots using matplotlib tools after calling pyshow() (=pyplot.show)

Usage

1
2
pyplot(x, y, color = "b", marker = "", alpha = 1, linewidth = 1,
  linestyle = "-", args = NULL, show = FALSE)

Arguments

x

numeric vector containing the x coordinates of points

y

numeric vector containing the y coordinates of points

color

color of the points (default: "b"), can be one of

marker

single character indicating shape of the points (default: "o"), see http://matplotlib.org/api/markers_api.html#module-matplotlib.markers

alpha

numeric indicating transparency (0-1, default: 1)

linewidth

numeric of either length 1 or length(x) indicating the border width of the points (default: 1)

linestyle

style of the plotted line. See: http://matplotlib.org/api/lines_api.html#matplotlib.lines.Line2D.set_linestyle

args

character string of further arguments passed to the **kwargs argument of matplotlib.pyplot.scatter

show

bool indicating whether to open a window with the plot

See Also

pyscatter http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot

Examples

1
2
3
4
5
6
7
8
9
x = seq(0, 2*pi, length=100)
pyplot(x, sin(x))
pyplot(x, cos(x), linewidth=3, color="red", linestyle="--")
pyfigure()
pyplot(x, sin(x)^2)
xlabel("x")
ylabel("$sin(x)^2$")
if(interactive())
   pyshow()

mpastell/Rpyplot documentation built on May 23, 2019, 6:27 a.m.