Axis
Basic Options
Color
Default Value: #444
Type: color
Documentation: Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this.
Path: layout.xaxis.color
Type
Default Value: -
Type: enumerated
Enum Options: -,linear,log,date,category,multicategory
Documentation: Sets the axis type. By default, plotly attempts to determined the axis type by looking into the data of the traces that referenced the axis in question.
Path: layout.xaxis.type
Visible
Type: boolean
Documentation: A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false
Path: layout.xaxis.visible
Title Attributes
Standoff
Type: number
Min: 0
Documentation: Sets the standoff distance (in px) between the axis labels and the title text The default value is a function of the axis tick labels, the title font.size
and the axis linewidth
. Note that the axis title position is always constrained within the margins, so the actual standoff distance is always less than the set or default value. By setting standoff
and turning on automargin
, plotly.js will push the margins to fit the axis title at given standoff distance.
Path: layout.xaxis.title.standoff
Text
Type: string
Documentation: Sets the title of this axis. Note that before the existence of title.text
, the title's contents used to be defined as the title
attribute itself. This behavior has been deprecated.
Path: layout.xaxis.title.text
Styling and Appearance
Auto Margin
Default Value: false
Type: flaglist
Flag Options: height,width,left,right,top,bottom
Flag Single: true,false
Documentation: Determines whether long tick labels automatically grow the figure margins.
Path: layout.xaxis.automargin
Layer
Default Value: above traces
Type: enumerated
Enum Options: above traces,below traces
Documentation: Sets the layer on which this axis is displayed. If above traces, this axis is displayed above all the subplot's traces If below traces, this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with cliponaxis
set to false to show markers and/or text nodes above this axis.
Path: layout.xaxis.layer
Line Color
Default Value: #444
Type: color
Documentation: Sets the axis line color.
Path: layout.xaxis.linecolor
Line Width
Default Value: 1
Type: number
Min: 0
Documentation: Sets the width (in px) of the axis line.
Path: layout.xaxis.linewidth
Mirror
Default Value: false
Type: enumerated
Enum Options: true,ticks,false,all,allticks
Documentation: Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If true, the axis lines are mirrored. If ticks, the axis lines and ticks are mirrored. If false, mirroring is disable. If all, axis lines are mirrored on all shared-axes subplots. If allticks, axis lines and ticks are mirrored on all shared-axes subplots.
Path: layout.xaxis.mirror
Position
Default Value: 0
Type: number
Min: 0
Max: 1
Documentation: Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if anchor
is set to free.
Path: layout.xaxis.position
Show Line
Default Value: false
Type: boolean
Documentation: Determines whether or not a line bounding this axis is drawn.
Path: layout.xaxis.showline
Side
Type: enumerated
Enum Options: top,bottom,left,right
Documentation: Determines whether a x (y) axis is positioned at the bottom (left) or top (right) of the plotting area.
Path: layout.xaxis.side
Grid Options
Grid Color
Default Value: #eee
Type: color
Documentation: Sets the color of the grid lines.
Path: layout.xaxis.gridcolor
Grid Dash
Default Value: solid
Type: string
Enum Options: solid,dot,dash,longdash,dashdot,longdashdot
Documentation: Sets the dash style of lines. Set to a dash type string (solid, dot, dash, longdash, dashdot, or longdashdot) or a dash length list in px (eg 5px,10px,2px,2px).
Path: layout.xaxis.griddash
Grid Width
Default Value: 1
Type: number
Min: 0
Documentation: Sets the width (in px) of the grid lines.
Path: layout.xaxis.gridwidth
Show Grid
Type: boolean
Documentation: Determines whether or not grid lines are drawn. If true, the grid lines are drawn at every tick mark.
Path: layout.xaxis.showgrid
Zero Line
Type: boolean
Documentation: Determines whether or not a line is drawn at along the 0 value of this axis. If true, the zero line is drawn on top of the grid lines.
Path: layout.xaxis.zeroline
Zero Line Color
Default Value: #444
Type: color
Documentation: Sets the line color of the zero line.
Path: layout.xaxis.zerolinecolor
Zero Line Width
Default Value: 1
Type: number
Documentation: Sets the width (in px) of the zero line.
Path: layout.xaxis.zerolinewidth
Range Options
Auto Range
Default Value: true
Type: enumerated
Enum Options: true,false,reversed,min reversed,max reversed,min,max
Documentation: Determines whether or not the range of this axis is computed in relation to the input data. See rangemode
for more info. If range
is provided and it has a value for both the lower and upper bound, autorange
is set to false. Using min applies autorange only to set the minimum. Using max applies autorange only to set the maximum. Using min reversed applies autorange only to set the minimum on a reversed axis. Using max reversed applies autorange only to set the maximum on a reversed axis. Using reversed applies autorange on both ends and reverses the axis direction.
Path: layout.xaxis.autorange
Category Array
Type: any
Accept List: true
Documentation: Sets the order in which categories on this axis appear. Only has an effect if categoryorder
is set to array. Used with categoryorder
.
Path: layout.xaxis.categoryarray
Category Order
Default Value: trace
Type: enumerated
Enum Options: trace,category ascending,category descending,array,total ascending,total descending,min ascending,min descending,max ascending,max descending,sum ascending,sum descending,mean ascending,mean descending,median ascending,median descending
Documentation: Specifies the ordering logic for the case of categorical variables. By default, plotly uses trace, which specifies the order that is present in the data supplied. Set categoryorder
to category ascending or category descending if order should be determined by the alphanumerical order of the category names. Set categoryorder
to array to derive the ordering from the attribute categoryarray
. If a category is not found in the categoryarray
array, the sorting behavior for that attribute will be identical to the trace mode. The unspecified categories will follow the categories in categoryarray
. Set categoryorder
to total ascending or total descending if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values.
Path: layout.xaxis.categoryorder
Fixed Range
Default Value: false
Type: boolean
Documentation: Determines whether or not this axis is zoom-able. If true, then zoom is disabled.
Path: layout.xaxis.fixedrange
Range
Type: info_array
Documentation: Sets the range of this axis. If the axis type
is log, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis type
is date, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis type
is category, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. Leaving either or both elements null
impacts the default autorange
.
Path: layout.xaxis.range
Range Mode
Default Value: normal
Type: enumerated
Enum Options: normal,tozero,nonnegative
Documentation: If normal, the range is computed in relation to the extrema of the input data. If tozero`, the range extends to 0, regardless of the input data If nonnegative, the range is non-negative, regardless of the input data. Applies only to linear axes.
Path: layout.xaxis.rangemode
Visible
Default Value: true
Type: boolean
Documentation: Determines whether or not the range slider will be visible. If visible, perpendicular axes will be set to fixedrange
Path: layout.xaxis.rangeslider.visible
Ticks Basics Options
D Tick
Type: any
Documentation: Sets the step in-between ticks on this axis. Use with tick0
. Must be a positive number, or special strings available to log and date axes. If the axis type
is log, then ticks are set every 10^(n*dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. log has several special values; L, where f
is a positive number, gives ticks linearly spaced in value (but not position). For example tick0
= 0.1, dtick
= L0.5 will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use D1 (all digits) or D2 (only 2 and 5). tick0
is ignored for D1 and D2. If the axis type
is date, then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set dtick
to 86400000.0. date also has special values M gives ticks spaced by a number of months. n
must be a positive integer. To set ticks on the 15th of every third month, set tick0
to 2000-01-15 and dtick
to M3. To set ticks every 4 years, set dtick
to M48
Path: layout.xaxis.dtick
N Ticks
Default Value: 0
Type: integer
Min: 0
Documentation: Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to nticks
. Has an effect only if tickmode
is set to auto.
Path: layout.xaxis.nticks
Tick Color
Default Value: #444
Type: color
Documentation: Sets the tick color.
Path: layout.xaxis.tickcolor
Tick Len
Default Value: 5
Type: number
Min: 0
Documentation: Sets the tick length (in px).
Path: layout.xaxis.ticklen
Ticks
Type: enumerated
Enum Options: outside,inside,
Documentation: Determines whether ticks are drawn or not. If **, this axis' ticks are not drawn. If outside (inside), this axis' are drawn outside (inside) the axis lines.
Path: layout.xaxis.ticks
Tick Width
Default Value: 1
Type: number
Min: 0
Documentation: Sets the tick width (in px).
Path: layout.xaxis.tickwidth
Spike Options
Show Spikes
Default Value: false
Type: boolean
Documentation: Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest
Path: layout.xaxis.showspikes
Spike Color
Type: color
Documentation: Sets the spike color. If undefined, will use the series color
Path: layout.xaxis.spikecolor
Spike Dash
Default Value: dash
Type: string
Enum Options: solid,dot,dash,longdash,dashdot,longdashdot
Documentation: Sets the dash style of lines. Set to a dash type string (solid, dot, dash, longdash, dashdot, or longdashdot) or a dash length list in px (eg 5px,10px,2px,2px).
Path: layout.xaxis.spikedash
Spike Mode
Default Value: toaxis
Type: flaglist
Flag Options: toaxis,across,marker
Documentation: Determines the drawing mode for the spike line If toaxis, the line is drawn from the data point to the axis the series is plotted on. If across, the line is drawn across the entire plot area, and supercedes toaxis. If marker, then a marker dot is drawn on the axis the series is plotted on
Path: layout.xaxis.spikemode
Spike Snap
Default Value: hovered data
Type: enumerated
Enum Options: data,cursor,hovered data
Documentation: Determines whether spikelines are stuck to the cursor or to the closest datapoints.
Path: layout.xaxis.spikesnap
Spike Thickness
Default Value: 3
Type: number
Documentation: Sets the width (in px) of the zero line.
Path: layout.xaxis.spikethickness
Tick Labels Options
Show Tick Labels
Default Value: true
Type: boolean
Documentation: Determines whether or not the tick labels are drawn.
Path: layout.xaxis.showticklabels
Show Tick Prefix
Default Value: all
Type: enumerated
Enum Options: all,first,last,none
Documentation: If all, all tick labels are displayed with a prefix. If first, only the first tick is displayed with a prefix. If last, only the last tick is displayed with a suffix. If none, tick prefixes are hidden.
Path: layout.xaxis.showtickprefix
Show Tick Suffix
Default Value: all
Type: enumerated
Enum Options: all,first,last,none
Documentation: Same as showtickprefix
but for tick suffixes.
Path: layout.xaxis.showticksuffix
Tick Angle
Default Value: auto
Type: angle
Documentation: Sets the angle of the tick labels with respect to the horizontal. For example, a tickangle
of -90 draws the tick labels vertically.
Path: layout.xaxis.tickangle
Tick Format
Default Value:
Type: string
Documentation: Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 091523.46
Path: layout.xaxis.tickformat
Tick Label Overflow
Type: enumerated
Enum Options: allow,hide past div,hide past domain
Documentation: Determines how we handle tick labels that would overflow either the graph div or the domain of the axis. The default value for inside tick labels is hide past domain. Otherwise on category and multicategory axes the default is allow. In other cases the default is hide past div.
Path: layout.xaxis.ticklabeloverflow
Tick Label Position
Default Value: outside
Type: enumerated
Enum Options: outside,inside,outside top,inside top,outside left,inside left,outside right,inside right,outside bottom,inside bottom
Documentation: Determines where tick labels are drawn with respect to the axis Please note that top or bottom has no effect on x axes or when ticklabelmode
is set to period. Similarly left or right has no effect on y axes or when ticklabelmode
is set to period. Has no effect on multicategory axes or when tickson
is set to boundaries. When used on axes linked by matches
or scaleanchor
, no extra padding for inside labels would be added by autorange, so that the scales could match.
Path: layout.xaxis.ticklabelposition
Tick Label Step
Default Value: 1
Type: integer
Min: 1
Documentation: Sets the spacing between tick labels as compared to the spacing between ticks. A value of 1 (default) means each tick gets a label. A value of 2 means shows every 2nd label. A larger value n means only every nth tick is labeled. tick0
determines which labels are shown. Not implemented for axes with type
log or multicategory, or when tickmode
is array.
Path: layout.xaxis.ticklabelstep
Tick Prefix
Default Value:
Type: string
Documentation: Sets a tick label prefix.
Path: layout.xaxis.tickprefix
Tick Suffix
Default Value:
Type: string
Documentation: Sets a tick label suffix.
Path: layout.xaxis.ticksuffix
Custom Ticks
Tick Mode
Type: enumerated
Enum Options: auto,linear,array,sync
Documentation: Sets the tick mode for this axis. If auto, the number of ticks is set via nticks
. If linear, the placement of the ticks is determined by a starting position tick0
and a tick step dtick
(linear is the default value if tick0
and dtick
are provided). If array, the placement of the ticks is set via tickvals
and the tick text is ticktext
. (array is the default value if tickvals
is provided). If sync, the number of ticks will sync with the overlayed axis set by overlaying
property.
Path: layout.xaxis.tickmode
Tick Text
Type: any
Accept List: true
Documentation: Sets the text displayed at the ticks position via tickvals
. Only has an effect if tickmode
is set to array. Used with tickvals
.
Path: layout.xaxis.ticktext
Tick Vals
Type: any
Accept List: true
Documentation: Sets the values at which ticks on this axis appear. Only has an effect if tickmode
is set to array. Used with ticktext
.
Path: layout.xaxis.tickvals
Calendar Options
Calendar
Default Value: gregorian
Type: enumerated
Enum Options: chinese,coptic,discworld,ethiopian,gregorian,hebrew,islamic,jalali,julian,mayan,nanakshahi,nepali,persian,taiwan,thai,ummalqura
Documentation: Sets the calendar system to use for range
and tick0
if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global layout.calendar
Path: layout.xaxis.calendar
Exponent Options
Exponent Format
Default Value: B
Type: enumerated
Enum Options: none,e,E,power,SI,B
Documentation: Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If none, it appears as 1,000,000,000. If e, 1e+9. If E, 1E+9. If power, 1x10^9 (with 9 in a super script). If SI, 1G. If B, 1B.
Path: layout.xaxis.exponentformat
Min Exponent
Default Value: 3
Type: number
Min: 0
Documentation: Hide SI prefix for 10^n if |n| is below this number. This only has an effect when tickformat
is SI or B.
Path: layout.xaxis.minexponent
Show Exponent
Default Value: all
Type: enumerated
Enum Options: all,first,last,none
Documentation: If all, all exponents are shown besides their significands. If first, only the exponent of the first tick is shown. If last, only the exponent of the last tick is shown. If none, no exponents appear.
Path: layout.xaxis.showexponent
Miscellaneous
Auto Type Numbers
Default Value: convert types
Type: enumerated
Enum Options: convert types,strict
Documentation: Using strict a numeric string in trace data is not converted to a number. Using convert types a numeric string in trace data may be treated as a number during automatic axis type
detection. Defaults to layout.autotypenumbers.
Path: layout.xaxis.autotypenumbers
Hover Format
Default Value:
Type: string
Documentation: Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: %h for half of the year as a decimal number as well as %{n}f for fractional seconds with n digits. For example, 2016-10-13 09:15:23.456 with tickformat %H~%M~%S.%2f would display 091523.46
Path: layout.xaxis.hoverformat
Last updated