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
51
votes
5 answers

Plotly notebook mode with google colaboratory

I am am trying out colaboratory with plotly notebook mode - I open a new notebook, copy and paste the following simple example from plotly's documentation, but don't see an output. There is a large blank in the output space where the plot whould…
elz
  • 5,338
  • 3
  • 28
  • 30
48
votes
3 answers

How to plot 3D scatter diagram using ggplot?

I tried to use the plotly package, but it is not working in my case at all. The ggplot package is working for 2D plots but it is giving an error when adding one more axis. How to solve this issue? ggplot(data,aes(x=D1,y=D2,z=D3,color=Sample)) + …
R June
  • 655
  • 1
  • 6
  • 8
47
votes
5 answers

How to use dash within Jupyter notebook or JupyterLab?

Is it possible to have a dash app within a Jupyter Notebook, rather than served up and viewed in a browser? My intention is to link graphs within a Jupyter notebook so that hovering over one graph generates the input required for another graph.
bluprince13
  • 4,607
  • 12
  • 44
  • 91
45
votes
3 answers

Formatting mouse over labels in plotly when using ggplotly

I am struggling with text formatting when using ggplotly and the mouse over functionality. library(plotly) df <- data.frame(a=letters, b=LETTERS, x=runif(26), y=runif(26)) g <- ggplot(df, aes(x,y)) + geom_point(aes(text=sprintf('letter: %s\nLetter:…
drmariod
  • 11,106
  • 16
  • 64
  • 110
45
votes
1 answer

Remove space between subplots in Plotly?

I have a a large space in between my subplots in plotly. In matplotlib, there is a layout called a tight layout that removes this. Is there any similar layout in plotly? I am plotting in an iPython notebook so there is limited space. See the space…
pr338
  • 8,730
  • 19
  • 52
  • 71
43
votes
3 answers

How to hide legend with Plotly Express and Plotly

I am trying to learn Plotly by firstly creating a simple bar chart in Plotly Express and then updating it with Plotly to finesse it. I would like to hide the legend. I am trying to update the original figure by hiding the legend, and I can't get it…
krazykrejza
  • 579
  • 2
  • 6
  • 12
42
votes
3 answers

Use Pandas index in Plotly Express

Plotly Express allows me to easily plot a pandas dataframe, as explained in their examples. Rather than using a named column for x and a named column for y, I would like to use the dataframe's index for x and a named column for y. Example using…
Laurens Koppenol
  • 2,946
  • 2
  • 20
  • 33
41
votes
5 answers

How to change variable/label names for the legend in a plotly express line chart

I want to change the variable/label names in plotly express in python. I first create a plot: import pandas as pd import plotly.express as px d = {'col1': [1, 2, 3], 'col2': [3, 4, 5]} df = pd.DataFrame(data=d) fig = px.line(df, x=df.index,…
emil banning
  • 475
  • 1
  • 4
  • 8
41
votes
5 answers

How to save plotly express plot into a html or static image file?

However, I feel saving the figure with plotly.express is pretty tricky. How to save plotly.express or plotly plot into a individual html or static image file? Anyone can help?
roudan
  • 3,082
  • 5
  • 31
  • 72
41
votes
4 answers

Horizontal/Vertical Line in plotly

I'm using the plotly package and I'm trying to add a horizontal line to a graph. Is there any way of doing it using plotly? It can be done using ggplot2 and the ggplotly function as shown below: library(plotly) p <- ggplot() + …
Sam Helmich
  • 949
  • 1
  • 8
  • 18
41
votes
4 answers

Same scale for x and y axis

I am using plotly for python and I can't set x and y axis so they could have the same scale: Here is my layout: layout = Layout( xaxis=XAxis( range=[-150, 150], showgrid=True, zeroline=True, showline=True, …
farhawa
  • 10,120
  • 16
  • 49
  • 91
39
votes
7 answers

How to get Plotly.js default colors list?

I am plotting a plotly bubble chart on a webpage.. I want to get the list of default colors, plotly uses to draw the bubbles.
Sushil Kumar
  • 1,401
  • 2
  • 14
  • 27
39
votes
4 answers

Disable hover information on trace, plotly

I'm currently using the plotly service to graph some water quality data. I've added some lines to represent the the various stages of water quality, with them shaded so they are green, yellow, and red. I've been able to remove some unnecessary…
ChrisDevWard
  • 885
  • 2
  • 9
  • 20
37
votes
3 answers

Embedding a Plotly chart in a Django template

I am trying to embed a plotly pie chart in a Django html template. This works fine when the chart is produced in 'online mode' (i.e. the html snippet is stored on the plotly server) but not in 'offline mode' (i.e. when the html is stored locally).…
Hooloovoo
  • 865
  • 2
  • 11
  • 21
36
votes
2 answers

how to hide plotly yaxis title (in python)?

Editing: The following example from Plotly for reference: import plotly.express as px df = px.data.gapminder().query("continent == 'Europe' and year == 2007 and pop > 2.e6") fig = px.bar(df, y='pop', x='country',…
ZKK
  • 627
  • 1
  • 10
  • 16