> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xarchive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Plots

> Lines, histograms, areas, points, shapes, markers, fills, levels, backgrounds and bar colours.

Declared at the top level only, at most 64 plots, set in handlers. A plot not set on a bar is `na` there: a line or an area breaks (a gap), and a plot that says `join: true` is drawn straight across the bars it has no value on. Histograms and points draw nothing on such a bar.

## plot

<ResponseField name="line()" type="(title: string, options?: LinePlotOptions): Plot" />

<ResponseField name="histogram()" type="(title: string, options?: PlotOptions & { base?: number }): Plot" />

<ResponseField name="area()" type="(title: string, options?: PlotOptions & JoinOptions): Plot" />

<ResponseField name="points()" type="(title: string, options?: PlotOptions & { shape?: 'circle' | 'cross' }): Plot">
  Dots or crosses at each value, with no line between them.
</ResponseField>

<ResponseField name="shape()" type="(title: string, options: ShapeOptions): ShapePlot">
  A shape, a label or a character on the bars where `set` says so.
</ResponseField>

<ResponseField name="markers()" type="(title: string, options?: { pane?: PaneName }): MarkersPlot" />

<ResponseField name="fill()" type="(title: string, a: Plot | LevelPlot, b: Plot | LevelPlot, options?: { color?: Color | null }): ColorPlot">
  Shade between two plots or levels of this script, optionally per bar. Between two levels it
  is a band across the whole pane. A fill takes the offset of its first plot, colours included.
</ResponseField>

<ResponseField name="background()" type="(title: string, options?: { pane?: PaneName; offset?: number }): ColorPlot">
  Shade the whole height of the pane behind a bar.
</ResponseField>

<ResponseField name="level()" type="(title: string, price: number, options?: { color?: Color | null; style?: LineStyle; width?: LineWidth; pane?: PaneName; hidden?: boolean }): LevelPlot">
  A horizontal line across the pane, such as 70 on an RSI. Returns a handle a fill can use.
</ResponseField>

<ResponseField name="candles()" type="(title: string, options?: PlotOptions): CandlePlot" />

<ResponseField name="barColor()" type="(title: string, options?: { offset?: number }): ColorPlot">
  Recolour the chart's own candles, bodies, borders and wicks, as Pine's `barcolor` does.
  `null` leaves a bar in the chart's colours. Chart types without candles (footprints) say in
  the legend that it does not apply there.
</ResponseField>

## PlotOptions

<ResponseField name="color?" type="Color | null" />

<ResponseField name="pane?" type="PaneName" />

<ResponseField name="hidden?" type="boolean">
  Hide from the chart but keep in the legend and the data window.
</ResponseField>

<ResponseField name="precision?" type="number" />

<ResponseField name="axisLabel?" type="boolean">
  Show the last value as a tag on the price axis, without the line across the chart that
  `trackPrice` adds. Default: false on the price pane, true in the script's own pane.
</ResponseField>

<ResponseField name="margins?" type="{ top: number; bottom: number }">
  The scale margins of the scale this plot sits on, as fractions of the pane, such as `{ top: 0.2, bottom: 0.28 }`.
</ResponseField>

<ResponseField name="band?" type="{ top: number; bottom: number }">
  Draw on a hidden scale of its own inside the pane, between these fractions from the top and
  the bottom, such as volume at the foot of the price pane: `{ top: 0.84, bottom: 0 }`.
</ResponseField>

<ResponseField name="range?" type="{ min: number; max: number }">
  A fixed scale from `min` to `max` instead of autoscaling, such as `{ min: 0, max: 100 }`.
</ResponseField>

<ResponseField name="autoscale?" type="boolean">
  `false`: the plot is drawn at its values but does not stretch its scale, which fits the rest
  of the pane (the candles, on the price pane). For levels far from price, such as liquidation
  clusters, that would otherwise squash the candles into a line; parts outside the view are
  simply not seen. Default true.
</ResponseField>

<ResponseField name="offset?" type="number">
  Draw the plot shifted by this many bars, a whole number from -500 to 500. The value set on
  bar `i` is drawn on bar `i + offset`: a positive offset shifts the plot right, and its last
  values are drawn past the newest bar, in the empty space to its right (Ichimoku's leading
  spans); a negative one shifts it left (the lagging span). The legend reads the value drawn
  at the bar under the crosshair. Default 0.
</ResponseField>

## JoinOptions

<ResponseField name="join?" type="boolean">
  Draw the line (and the area's fill) across bars where the plot is `na`, from the last value
  to the next. Default false: the plot breaks there, as Pine's `plot.style_linebr` and
  `style_areabr` do. Pine's `style_line`, `style_stepline` and `style_area` join, and the
  translation of a pasted Pine script says so.
</ResponseField>

## LinePlotOptions

<ResponseField name="width?" type="LineWidth" />

<ResponseField name="style?" type="LineStyle" />

<ResponseField name="trackPrice?" type="boolean">
  Show the last value as a line across the chart and a tag on the price axis.
</ResponseField>

## Plot

<ResponseField name="set()" type="(value: number, color?: Color | null): void">
  The value for the current bar, optionally with this bar's colour.
</ResponseField>

## LevelPlot

A horizontal line across the whole pane (`plot.level`). It can be one side of a `plot.fill`.
`set` moves it: the line is drawn at the price in effect on the newest bar, across every bar.

<ResponseField name="set()" type="(price: number): void" />

## ShapePlot

<ResponseField name="set()" type="(condition: boolean, options?: { price?: number; text?: string; color?: Color | null; textColor?: Color | null }): void">
  Draw the shape on the current bar when `condition` is true. `price` is used with
  `location: 'absolute'`; `text` and `color` replace the plot's own for this bar.
</ResponseField>

## ShapeOptions

<ResponseField name="shape?" type="ShapeName">
  The shape to draw. Give `char` instead to draw a character (Pine's `plotchar`).
</ResponseField>

<ResponseField name="char?" type="string">
  One character drawn in place of a shape, such as `'▲'` or `'•'`.
</ResponseField>

<ResponseField name="location" type="ShapeLocation" />

<ResponseField name="color?" type="Color | null" />

<ResponseField name="size?" type="Size" />

<ResponseField name="text?" type="string">
  Written beside the shape, or inside a `labelUp` / `labelDown` label.
</ResponseField>

<ResponseField name="textColor?" type="Color | null">
  The text's colour. Default: the shape's colour; inside a label, black or white, whichever reads on it.
</ResponseField>

<ResponseField name="pane?" type="PaneName" />

<ResponseField name="hidden?" type="boolean">
  Kept in the declaration but not drawn, like a plot's `hidden`.
</ResponseField>

<ResponseField name="offset?" type="number">
  Shift the shapes this many bars, as `PlotOptions.offset`.
</ResponseField>

## Marker

<ResponseField name="position" type="'above' | 'below' | 'at'" />

<ResponseField name="shape" type="ShapeName" />

<ResponseField name="price?" type="number" />

<ResponseField name="text?" type="string" />

<ResponseField name="color?" type="Color | null" />

## MarkersPlot

<ResponseField name="add()" type="(marker: Marker): void">
  Add a marker to the current bar. Several per bar are allowed.
</ResponseField>

## ColorPlot

<ResponseField name="set()" type="(color: Color | null): void">
  The colour for the current bar; `null` for none.
</ResponseField>

## CandlePlot

<ResponseField name="set()" type="(bar: { open: number; high: number; low: number; close: number }, color?: Color | null): void" />

## Next step

Continue with [Drawings](/terminal/reference/drawings).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.