Questions tagged [plotly]

Plotly.js is an open source, high-level, declarative charting library, built on top of d3.js and stack.gl. It ships with over 40 chart types, including 3D charts, statistical graphs, and SVG maps. Use [r-plotly] for the R package and [plotly-python] for the Python package.

You can use Plotly to import and analyze data, create beautiful, interactive, browser-based graphs, and then collaborate on your graphs with others. Plotly also has a Python sandbox (NumPy supported), and has APIs for Python, R, MATLAB, Arduino, Julia, Perl, and REST.

You can see more in the gallery.

enter image description here

Resources

13887 questions
36
votes
4 answers

How to customize hover-template on with what information to show

Here is my dataset: After locking my dataframe by year and grouping by month, I proceed with calculating percentage increase/decrease as a new column; it ends up looking like this: Now for my Plotly plot I use this to display traces and add some…
DGomonov
  • 715
  • 1
  • 7
  • 19
36
votes
3 answers

How to plot multiple lines on the same y-axis using Plotly Express in Python

I just installed plotly express. And I am trying to do something simple - plot each column of my data frame on the same y-axis with the index as x-axis. Here are questions/observations: Is it necessary for the data frame to have index as a column to…
UGuntupalli
  • 769
  • 1
  • 9
  • 22
36
votes
6 answers

how can i create subplots with plotly express?

been loving the plotly express graphs but want to create a dashboard with them now. Did not find any documentation for this. Is this possible?
Animesh Dwivedi
  • 461
  • 1
  • 4
  • 4
36
votes
8 answers

How to embed Plotly graphs in Sphinx documentation and nbsphinx

I tried using nbsphinx to embed a Jupyter notebook containing plotly plots, but the plots don't show up in the documentation, even though they look fine on the Jupyter notebook. How can I embed a plotly graph in Sphinx documentation? I could…
bluprince13
  • 4,607
  • 12
  • 44
  • 91
35
votes
2 answers

Plotly/Dash display real time data in smooth animation

We are trying to produce a real-time dashboard in plotly-dash that displays live data as it is produced. We are generally following the guidance here (https://dash.plotly.com/live-updates). We have a callback that gathers a chunk of new data points…
David Parks
  • 30,789
  • 47
  • 185
  • 328
35
votes
2 answers

Plotly express vs. Altair/Vega-Lite for interactive plots

Recently I am learning both Plotly express and Altair/Vega-Lite for interactive plotting. Both of them are quite impressive and I am wondering what their strengths and weaknesses are. Especially for creating interactive plots, are there any big…
roudan
  • 3,082
  • 5
  • 31
  • 72
34
votes
4 answers

Saving multiple plots into a single html

I recently discovered plotly and find it really good for graphing, now I have a problem which I want to save multiple plot into a single html, how to do it please? *I want to save multiple plot, i.e fig, fig1, fig 2 and so on, NOT one subplot which…
Victor
  • 659
  • 3
  • 8
  • 19
34
votes
1 answer

How to add line breaks to plotly hover labels

Is there a way to get plotly to display the hover text on multiple lines/get it to recognize special characters line '\n' in the text? A dummy version of what I'm looking to do is: data <- data.frame(cbind(rnorm(10, 8), rnorm(10,…
rabbert_klein
  • 383
  • 1
  • 3
  • 5
33
votes
14 answers

plotly.offline.iplot gives a large blank field as its output in Jupyter Notebook/Lab

I am trying to create a Sankey chart in a Jupyter notebook, basing my code on the first example shown here. I ended up with this, which I can run without getting any errors: import numpy as npy import pandas as pd import plotly as…
eirikdaude
  • 3,106
  • 6
  • 25
  • 50
33
votes
2 answers

Using R and plot.ly - how do I script saving my output as a webpage

I want to make some interactive graphs using R and plot.ly. When I run the following code in R-Studio, it produces an interactive graph. library(plotly) set.seed(100) d <- diamonds[sample(nrow(diamonds), 1000), ] plot_ly(d, x = carat, y = price,…
Slavatron
  • 2,278
  • 5
  • 29
  • 40
32
votes
1 answer

Highlight all values from a group on hover

Assume data library(ggplot2) library(plotly) set.seed(357) xy <- data.frame(letters = rep(c("a", "b", "c"), times = 3), values = runif(9), groups = rep(c("group1", "group2", "group3"), each = 3)) letters …
Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
32
votes
5 answers

How can I change the size of my Dash Graph?

I'm running into layout difficulties with the plots on Dash. All the plots I generate with Dash seem to be auto sized to be very narrow, which makes it hard to actually view the data without some creative zooming. As an example, when I view the…
FelixVelariusBos
  • 435
  • 1
  • 5
  • 8
32
votes
4 answers

Using plotly without online plotly account

Is it possible to use the plotly library to create charts in python without having an online plotly account? I think the code is opensource https://github.com/plotly/plotly.py. I would like to know whether we can use this without an online account.
Harnish
  • 811
  • 2
  • 11
  • 14
31
votes
1 answer

How to define colors in a figure using Plotly Graph Objects and Plotly Express

There are many questions and answers that touch upon this topic one way or another. With this contribution I'd like to clearly show why an easy approch such as marker = {'color' : 'red'} will work for plotly.graph_objects (go), but color='red' will…
vestland
  • 55,229
  • 37
  • 187
  • 305
31
votes
2 answers

Changing visibility of a Dash Component by updating other Component

I need to hide some Components, for example by clicking on a checkbox (for example, a graph or a table). However, the documentation did not provide a suitable section for this purpose. Thanks in advance!