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
28
votes
1 answer

KeyError: 'plotly_domain' when using plotly to do scatter plot in python

I'm using plotly to do scatter plot. The graph is generated on my account but the terminal still reports an error: Traceback (most recent call last): File "IEORE4709HW1.py", line 106, in py.iplot(data, filename='basic-scatter') File…
Jorvey
  • 281
  • 1
  • 3
  • 3
27
votes
4 answers

How to export a plotly dashboard app into a html standalone file to share with the others?

I have built a plotly interactive dashboard, and am looking a way to export this app to HTML format, and share it with others. Is there any hints for me? I have googled, and most answer divert me to the following…
yts61
  • 1,142
  • 2
  • 20
  • 33
27
votes
2 answers

How to install a package in Julia 1.0 (UndefVarError: Pkg not defined)

I installed Julia 1.0, and want to make a simple plot. The first step is to type this on Julia: Pkg.add("PyPlot") However, an error occurs: ERROR: UndefVarError: Pkg not defined. The same thing happens when I type: Pkg.status() What's the best…
Jimmy Li
  • 475
  • 2
  • 5
  • 9
27
votes
2 answers

Convert ggplot object to plotly in shiny application

I am trying to convert a ggplot object to plotly and show it in a shiny application. But I encountered an error "no applicable method for 'plotly_build' applied to an object of class "NULL"" I was able to return the ggplot object to the shiny…
athlonshi
  • 1,711
  • 1
  • 19
  • 23
26
votes
1 answer

How do I set each plotly subplot title during graph creation loop?

I understand that if I want to set all of the subplot titles then I can do that when I declare the figure. import pandas as pd import plotly.graph_objs as go from plotly.subplots import make_subplots fig = make_subplots( ### …
wex52
  • 475
  • 1
  • 4
  • 11
26
votes
3 answers

Customizing the order of legends in plotly

I am trying to customize the order of legends while plotting stacked bar plots in plotly,python. data = [ go.Bar( y=df['sid'], # assign x as the dataframe column 'x' x=df['A'], orientation='h', …
Natasha
  • 1,111
  • 5
  • 28
  • 66
26
votes
1 answer

How to define the structure of a sankey diagram using a pandas dataframe

This may sound like a very broad question, but if you'll let me describe some details I can assure you it's very specific. As well as discouraging, frustrating and rage-inducing. The following plot describes a Scottish election and is based on code…
vestland
  • 55,229
  • 37
  • 187
  • 305
26
votes
7 answers

Plotly legend title

I'd like to be able to add a title to the legend, in the following code. However, looking at the docs, I don't think there is a method for this. import plotly.plotly as py import plotly.graph_objs as go trace0 = go.Scatter( x=[1, 2, 3, 4, 5], …
bluprince13
  • 4,607
  • 12
  • 44
  • 91
26
votes
2 answers

Format axis tick labels to percentage in plotly

I am creating bar charts in plotly with y-axis representing percentages or shares within 0-1. The y-axis displays as 0.05 instead of 5.0%. Is there a way to display y-axis tick labels as %##? I have tried using tickformat = "%" but that doesn't seem…
Binny
  • 263
  • 1
  • 3
  • 7
26
votes
0 answers

Interactive selection in ggplotly with geom_hex() scatterplot

I am trying to create a scatterplot matrix with interactive selection between geom items in individual matrix plots. This works when I am dealing with geom_points (inside ggpairs()). When a user selects points in any of the 3 bottom-left individual…
user2808302
26
votes
3 answers

How to show all x-axis tick values in Plotly?

I am using this library https://plot.ly/nodejs/axes/ to plot graphs in node.js. I have this code: var data = [ { x: xs, y: ys, type: "scatter" } ]; var graphOptions = {filename: "date-axes", fileopt: "overwrite"}; plotly.plot(data,…
omega
  • 40,311
  • 81
  • 251
  • 474
26
votes
4 answers

Plotly update data

Okay so i have the following code: var element = document.getElementById(scope.changeid); function getData(division,redraw) { var employeeData = []; if (!division) { $http.get(api.getUrl('competenceUserAverageByMyDivisions',…
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
25
votes
4 answers

Change pandas plotting backend to get interactive plots instead of matplotlib static plots

When I use pandas df.plot() it has matplotlib as a default plotting backend. But this creates static plots. I would like interactive plots, so I have to change the pandas plotting background. How do I do change the plotting backend of pandas to…
Sander van den Oord
  • 10,986
  • 5
  • 51
  • 96
25
votes
4 answers

Save Jupyter Notebook with Plotly Express widgets displaying

I have a Jupyter notebook (python) where I used plotly express to plot in the notebook for analysis purposes. I want to share this notebook with non-coders, and have the interactive visuals be available still - but it does not seem to work. I tried…
guyts
  • 899
  • 2
  • 17
  • 34
25
votes
4 answers

Plotly gives an empty field as output in jupyter lab

I'm using plotly at jupyter lab, but I'm getting a blanked output. I'm having exactly the same problem described here: plotly.offline.iplot gives a large blank field as its output - why? And I tried what they suggested in the answers, but it didn't…
Leda Grasiele
  • 413
  • 1
  • 6
  • 14