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

How to remove option bar from ggplotly plot?

I have a plot that I am rendering in shiny using plotly and ggplot2. However, I do not want the option bar that appears on hover to appear. Is there a way to use ggplotly(p) and remove the option bar?
Climbs_lika_Spyder
  • 6,004
  • 3
  • 39
  • 53
24
votes
2 answers

Plotly: How to change the colorscheme of a plotly express scatterplot?

I am trying to work with plotly, specifically ploty express, to build a few visualizations. One of the things I am building is a scatterplot I have some code below, that produces a nice scatterplot: import plotly.graph_objs as go, pandas as pd,…
artemis
  • 6,857
  • 11
  • 46
  • 99
24
votes
3 answers

How to draw a multiple line chart using plotly_express?

I need to create a line chart from multiple columns of a dataframe. In pandas, you can draw a multiple line chart using a code as follows: df.plot(x='date', y=['sessions', 'cost'], figsize=(20,10), grid=True) How can this be done using…
Ryan
  • 1,247
  • 1
  • 10
  • 12
24
votes
2 answers

How to change default order of nodes in a sankey diagram

I created a Sankey diagram using the plotly package. As far as I see, the default order of nodes is mostly defined by the value. However, I want the alphabetical order without manually moving nodes with mouse drug. Can I change the default…
cuttlefish44
  • 6,586
  • 2
  • 17
  • 34
24
votes
2 answers

Displaying image on point hover in Plotly

Plotly allows you to display text fields when hovering over a point on a scatterplot. Is it possible to instead display an image associated with each point when the user hovers over or clicks on it? I am mostly just using the web interface, but I…
half-pass
  • 1,851
  • 4
  • 22
  • 33
23
votes
4 answers

How to obtain generated x-axis and y-axis range in plotly plot?

I have a very simple bubble chart, see below. the only thing i need is to be able to get the range (or the min and max) or the x and y axis generated. trace = go.Scatter( x=df_test['total_points_mean'], y=df_test['total_points_std'], …
Steven Cunden
  • 395
  • 1
  • 3
  • 9
23
votes
2 answers

plotly.py: change line opacity, leave markers opaque

Is it possible to change the line opacity but not the marker opacity? I found that I can set the opacity of the entire line including markers (opacity = .5) and the one of the marker (e.g. marker={"opacity":1}). As shown in this example: import…
stklik
  • 834
  • 1
  • 8
  • 19
23
votes
2 answers

plotly inside jupyter notebook python

Does anyone know how to use plotly inside jupyter notebook using python? The documentation is not very well organized, at-least not from my point of view. For example, I can run the following code but it generates a graph in a HTML file that can be…
codingknob
  • 11,108
  • 25
  • 89
  • 126
23
votes
3 answers

Show legend and label axes in plotly 3D scatter plots

Sorry for keeping you busy with plotly questions today. Here would be another one: How would I show the legend and axes labels on plotly's new 3D scatter plots? E.g., if I have the following scatter plot in 2D that produced everything fine, I added…
user2489252
23
votes
6 answers

Open a url by clicking a data point in plotly?

I have successfully created plotly graphs from python, and gone as far as creating custom html tooltips for the datapoints. But I haven't succeeded in adding functionality to open a link if someone clicks on a datapoint. What I would like is a…
wtfastro
  • 333
  • 1
  • 2
  • 6
22
votes
2 answers

Center plotly title by default

I have a plotly figure which I center the title using - fig.update_layout( title={ 'text' : title, 'x':0.5, 'xanchor': 'center' }) I have multiple graphs and I add this to every one of them. I…
Tom Ron
  • 5,906
  • 3
  • 22
  • 38
22
votes
3 answers

How to overlay two plots in same figure in plotly ( Create Pareto chart in plotly )?

I was trying to plot barplot and scatterplot in the same plot in plotly, but it shows only scatterplot. How to show both the plots? data import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from…
BhishanPoudel
  • 15,974
  • 21
  • 108
  • 169
22
votes
5 answers

Title for colorbar in Plotly Heatmap

This is my code: fig = go.Figure( data=go.Heatmap(z=z_values, y=[str(x) for x in params_1], x=[str(x) for x in params_2]), layout=go.Layout( title="Analysis results", xaxis=dict(title='Diameter'), …
TestGuest
  • 593
  • 1
  • 4
  • 16
22
votes
2 answers

How to add points or markers to line chart using plotly express?

plotly.express is very convenient to produce nice interactive plots. The code below generates a line chart colored by country. Now what I need is to add points to the plot. Does anyone know how I can add points to the line chart? import…
zesla
  • 11,155
  • 16
  • 82
  • 147
22
votes
3 answers

How to add caption & subtitle using plotly method in python

I'm trying to plot a bar chart using plotly and I wanted to add a caption and subtitle.(Here you can take any example of your choice to add caption and subtitle) My code for plotting the bar chart: import plotly.graph_objects as go fig =…
Maddy6
  • 367
  • 1
  • 3
  • 14