plot

The plot namespace provides chart plotting functionality. The namespace itself is callable — plot(...) records a value series for output. In PyneCore, plots are written to CSV output by default, but the mechanism can be extended. The plot.* constants control visual style and line appearance when used in compatible renderers.

Quick Example

from pynecore.lib import script, plot, close, ta

@script.indicator(title="SMA Plot Example", overlay=True)
def main():
    sma20: float = ta.sma(close, 20)
    plot(sma20, title="SMA 20")
    plot(close, title="Close")

Functions

plot()

Records a series value on every bar for output. In PyneCore, this writes the value to CSV by default.

ParameterTypeDefaultDescription
seriesanyThe value to record each bar.
titlestr | NoneNoneLabel for the plot. Defaults to "Plot". Duplicate titles are suffixed.

Returns: Plot — a plot reference object.

Note: plot() must be called from the script’s main() function. Calling it from a helper function raises RuntimeError.

p = plot(close, title="Close Price")

Constants

Style constants are passed to the style parameter of plot() in compatible renderers.

ConstantDescription
plot.style_areaArea fill style.
plot.style_areabrArea fill style with breaks on na values.
plot.style_circlesCircles at each bar.
plot.style_columnsVertical columns (bar chart style).
plot.style_crossCross markers at each bar.
plot.style_histogramHistogram bars relative to zero.
plot.style_lineContinuous line (default).
plot.style_linebrLine with breaks on na values.
plot.style_steplineStepped line.
plot.style_steplinebrStepped line with breaks on na values.
plot.style_stepline_diamondStepped line with diamond markers at each vertex.

Compatibility Notes

The following Pine Script plot namespace members are not available in PyneCore:

NameStatus
plot.linestyle_dashedNot available in PyneCore
plot.linestyle_dottedNot available in PyneCore
plot.linestyle_solidNot available in PyneCore

The plot() function accepts but silently ignores Pine Script visual parameters (color, linewidth, style, trackprice, etc.) for source-level compatibility. These have no effect in the current PyneCore output backend.