Plotly.js is a high-level, declarative charting library. It ships with 20 chart types, including 3D charts, statistical graphs, and SVG maps. It is built on top of d3.js and stack.gl.
Questions tagged [plotly.js]
396 questions
12
votes
1 answer
How to plot a vector field in Julia?
I want to plot a vector field in Julia. I could not find an example here.
Here there are some examples using plotly, however, they do not work for me. I would like to plot the vector field by plotlyjs or plotly.
Here is an example code in…
MOON
- 1,626
- 3
- 22
- 34
9
votes
1 answer
How to get grouped boxplots with vertical subplots
I'm trying to create a chart like the one in this image using Plotly.js:
It's a grouped boxplot (by sites, currently only one) with two y axes.
I've managed to create two versions, both of which don't work:
Create 5 traces (1 for each box) so that…
Baz
- 34,567
- 11
- 66
- 88
9
votes
1 answer
How to add colored background bars in plotly.js chart
How can "plot bands", or shaded areas in a chart, be added to a plotly-js chart? Something looking like this picture:
(Which comes from a different product: Highcharts)
Specifically, I would want to add background color to some portions (multiple…
herchu
- 857
- 6
- 23
5
votes
2 answers
Is there a way to show text in plotly graph tooltip without being overlapped?
As shown in codepen below, text value for trace 1 is being trimmed as it is close to chart border.
Need to show these numbers above everything else. Have tried setting z-index. Didn't worked.
https://codepen.io/satishvarada/pen/yLVoqqo
var trace1 =…
SatishV
- 323
- 3
- 16
5
votes
1 answer
Plotly: How to add polynomial fit line to plotly go.scatter figure using a DASH callback?
I'd like to add a polynomial curve to a scatter plot that is rendered using a callback.
Following is my callback function which returns the scatter plot.
@app.callback(Output('price-graph', 'figure'),
[
Input('select',…
kms
- 741
- 7
- 22
5
votes
1 answer
Update ‘x’ and ‘y’ values of a trace using Plotly.update()
Is it possible to update the x and y properties of a trace using Plotly.update()?
Updating the marker.color property of the trace works well. But when I try updating the x or y properties the trace disappears from the graph. And there is no…
Jeremiah England
- 451
- 6
- 12
5
votes
1 answer
plotly.js, how to adjust title area size
I have a scatter plot as shown below with code. How do I make the title area not take up this much space? Just to be clear, I don't mean the font size of the title, but the empty space the title area occupies.
var rstTrace = {
x: x_data,
…
Indominus
- 1,038
- 9
- 28
4
votes
1 answer
Plotly - Hide data on hover tooltip depending on value?
When I hover over a stacked line chart, it shows zeroes for all lines not in range. Is there a way to hide these values rather than adding noise to the hover tool?
Minimal Example
Plotly.newPlot('test', [{
line: { shape : 'vh' },
stackgroup:…
PattimusPrime
- 747
- 6
- 18
4
votes
1 answer
Plotly.js in relative barmode labels are overlapped when both bars have value 0
Continue my journey with Plotly.js. I'm using relative barmode and need to show some customized text when both opposite bars have value 0. The issue that for value 0 both bars grow in the same direction and labels are overlapped:
The only solution…
Anatoly
- 4,553
- 6
- 42
- 110
4
votes
0 answers
To highlight one point in Violin chart PlotlyJS
I am using Violin chart of PlotylyJS library, and it takes an array of elements and plots it on the chart. Is possible if I want to highlight one point with a different color from that array?
Like if my array is
demoViolin = [31.8, 63.5, 65, 59,…
Salomi Edward
- 209
- 1
- 11
4
votes
1 answer
Plotly JS line graph has very weird lines
So I have a site where I am doing some data modeling using plotly.js. I am plotting a large number of points (in the thousands). on my backend, I calculate regression equations for the points, and generate coordinates for each x value on the graph.…
wil moskal
- 299
- 1
- 13
4
votes
1 answer
Conditional formatting in Plotly
This question is about how to do conditional formatting in Plotly.
Instances where this might be needed:
Scatter plots where points need to be colored (i.e. rainbow) as a function of 2 variable;
Interactive charts where the coloring depends on the…
Sandu Ursu
- 841
- 14
- 22
4
votes
2 answers
Plotly.js display tooltip on hover over graph title
Plotly.js allows you to specify a graph title, but there doesn't seem to be an option for specifying a longer description to be shown on hovering over the title.
So, I added a title attribute to the text element that encloses the title text, and…
synaptik
- 7,677
- 13
- 58
- 89
4
votes
1 answer
Reduce Plotly.js library size
I am building a simple landing page which includes a 3d scatterplot graphic from plotly, nevertheless the minified library weights 3MB, way too big for a mobile landing page.
In this closed feature request, they speak about modularise the library so…
NicolasZ
- 608
- 1
- 8
- 21
4
votes
1 answer
Change the background color of a plot
I am using Plotly.js for plots on my website. I can't for the life of me figure out how to change the background color to anything besides white. Can that be done, or am I just missing something? Space isn't white, it is black, it would be nice to…
PearsonArtPhoto
- 35,989
- 16
- 107
- 136