Sidechair

plot()

Browse the reference

Draws a series on the chart as a line, histogram, columns, area, circles or steps, and returns a plot handle that fill can use.

Try it in the editor

plot draws one value per bar from series. Where the value is na, the default line style joins the last value before the gap to the first one after it, and plot.style_linebr leaves the line open across the gap. Histogram and column styles draw nothing at na. The call registers the plot once, using the title, style, linewidth and offset it has on its first bar; the color can change on every bar.

A plot appears in the legend and Data Window under its title, in the order of the plot calls in the script. The call returns a plot handle you can pass to fill, and Pine allows at most 64 plots per script.

A bool series is drawn as 1 for true and 0 for false.

Syntax

Pine Script
plot(series: series int/float, title: const string (optional), color: series color (optional), linewidth: input int (optional), style: input plot_style (optional), trackprice: input bool (optional), histbase: input int/float (optional), offset: simple int (optional), join: input bool (optional), editable: input bool (optional), show_last: input int (optional), display: input plot_display (optional), format: input string (optional), precision: input int (optional), force_overlay: const bool (optional), linestyle: input plot_line_style (optional)) -> plot

Arguments

NameTypeDefaultDescription
seriesseries int/floatrequiredSeries to draw. Numbers, or a bool drawn as 1 and 0.
titleconst string"Plot N"Name shown in the legend and Data Window.
colorseries color#2962FFSeries color, so it can change per bar. na hides that bar's segment.
linewidthinput int1Line thickness in pixels. A whole number of 1 or more.
styleinput plot_styleplot.style_lineDrawing style, a plot.style_* constant: line, linebr, stepline, stepline_diamond, steplinebr, histogram, columns, circles, cross, area or areabr.
trackpriceinput boolfalseAccepted for compatibility and ignored.
histbaseinput int/float0.0Base level that histogram, columns and area styles draw from.
offsetsimple int0Shifts the plot by this many bars; negative values move it to the left, into the past.
joininput boolfalseAccepted for compatibility and ignored.
editableinput booltrueAccepted for compatibility and ignored.
show_lastinput intnaAccepted for compatibility and ignored.
displayinput plot_displaydisplay.allWhere the plot is shown. display.none keeps it out of the chart.
formatinput stringformat.inheritAccepted for compatibility and ignored.
precisioninput intnaAccepted for compatibility and ignored.
force_overlayconst boolfalseWhen true, draws on the main chart pane even if the script runs in its own pane.
linestyleinput plot_line_styleplot.linestyle_solidAccepted for compatibility and ignored.

Returns

plot: a plot handle, accepted by fill.

Remarks

  • On Sidechair: stepline, stepline_diamond and steplinebr draw as step lines, with point markers added for the diamond style. circles and cross draw as dots, area and areabr draw as a filled area from histbase, and histogram and columns both draw as a histogram. steplinebr and areabr break at na the way linebr does.
  • On Sidechair: the arguments trackprice, join, show_last, format, precision and linestyle are accepted without effect, and a title left out becomes "Plot 1", "Plot 2" and so on by call order.
  • On Sidechair: line widths above 4 are drawn as 4.
  • Plot colors can use transparency: color.new(color.red, 70).

Example

Pine ScriptLine and histogram in one paneOpen in editor
//@version=6
indicator("Plot styles")
change = ta.change(close)
plot(change, "Change", color = change >= 0 ? color.teal : color.maroon, style = plot.style_columns)
plot(ta.sma(change, 10), "Average", color = color.orange, linewidth = 2)

See also

Runs on Sidechair