Questions tagged [plotly-python]

Use this tag for questions about the interactive graphing library for Python.

References:

2059 questions
5
votes
2 answers

Is there a way to dynamically change a plotly animation axis scale per frame?

I have an animated plotly scatter graph which plots x,y coordinates normally within the 0-0.5 range with date/time being the frame key. Sometime however I will have to handle anomalous data points which will be well out with this range. I would like…
Eog
  • 102
  • 11
5
votes
1 answer

How to set specific color to some bars in a plotly bar graph?

I'm trying to set different colors for some bars in a plotly express bar graph: import plotly.express as px import pandas as pd data = {'Name':['2020/01', '2020/02', '2020/03', '2020/04', '2020/05', '2020/07', '2020/08'], …
Mauro Assis
  • 375
  • 1
  • 5
  • 22
5
votes
1 answer

Plotly: How to define marker color based on category string value for a 3d scatter plot?

I am using plotly.graph_object for 3D scatter plot. I'd like to define marker color based on category string value. The category values are A2, A3, A4. How to modify below code? Thanks Here is what I did: import plotly.graph_objects as…
roudan
  • 3,082
  • 5
  • 31
  • 72
5
votes
1 answer

How do I increase the efficiency (speed) of dash-plotly line graph in python

I am using dash plotly in python. I am plotting real-time data which is being logged into an SQLite database, currently, I am plotting a single value vs timeline graph. I am planning to add 20 more graphs to this but currently, as time increases the…
rohith santosh
  • 28
  • 6
  • 23
5
votes
1 answer

Plotly: Hide `null` from hoverlabels

I have a list called my_customdata which has some nan values. When I plot a sunburst chart and pass my list to customdata, it displays the values as desired. But for the nan values, it instead shows 0 (if I pass si prefix settings along with…
5
votes
4 answers

Plotly: Remove legend title using template

Even after passing 'title':None inside layout.legend in the template, the chart still shows a legend title, whereas it should change the default setting to no legend title. If I manually pass it though with fig.update_layout(), it then removes the…
callmeanythingyouwant
  • 1,789
  • 4
  • 15
  • 40
5
votes
2 answers

Exporting Plotly charts with Kaleido not working?

I have locally created plotly charts in Jupyter Notebook that I'm trying to save as png files on my local machine. Example of charts: for table in EG_SD_pivots: df = EG_SD_pivots[table].reset_index() fig =…
sarahc123
  • 51
  • 1
  • 1
  • 2
5
votes
0 answers

How do I handle click events in a Plotly chart in Databricks?

I am interested in creating an interactive chart that is hosted in a Databricks notebook. I have been experimenting with Plotly, but I can't figure out how to get any custom interactivity working. Specifically, I need to have a click event handler.…
Evan Smith
  • 97
  • 7
5
votes
2 answers

Plotly: How to show other values than counts for marginal histogram?

I am trying to create a linked marginal plot above the original plot, with the same x axis but with a different y axis. I've seen that in plotly.express package there are 4 options in which you can create marginal_x plot on a scatter fig, but they…
5
votes
3 answers

Is there a way to use Plotly express to show multiple subplots

I'm keen to know if there is an equivalent to: import pandas as pd import numpy as np data = pd.DataFrame({'Day':range(10), 'Temperature': np.random.rand(10), 'Wind': np.random.rand(10), …
Myccha
  • 961
  • 1
  • 11
  • 20
5
votes
3 answers

Adding Vertical Rectangles to Plotly Subplots Without Using Plotly Express

I'm trying to create shaded areas that correspond to different date ranges in a plotly chart that has subplots. Ideally I'd like for each shaded rectangle to be suitably fitted to each subplot, but I'm finding this difficult. Here's some sample…
Jonathan Bechtel
  • 3,497
  • 4
  • 43
  • 73
5
votes
2 answers

Plotly: How to assign a variable to subplot titles?

I want to display extra data on several subplots and decided to do so in the subplot titles. I have figured out how to add a title to the subplots, but am not able to include a variable in each one. The code so far is: fig = make_subplots(rows=3,…
Patrick Miller
  • 335
  • 1
  • 3
  • 8
5
votes
2 answers

Plotly: How to put two 3D graphs on the same plot with plotly.graph_objects?

In below code, I draw 2 3D graphs with plotly.graph_objects. I'm unable to put them together. import plotly.graph_objects as go import numpy as np pts =…
Akira
  • 2,594
  • 3
  • 20
  • 45
5
votes
2 answers

How to label a grouped bar chart using plotly express?

I want to add data labels to the tops of bar charts in plotly express. I'm using two different columns from the data frame so I can't use the "colors" method. I want to define "text" for each bar so it shows the data on top of the bar. Here is an…
5
votes
1 answer

Plotly: How to change the size of the lines displayed in the legend?

I am having a really tough time to make legends bigger in plotly. I've exhausted the docs, forums, github issues and have found nothing. Starting to think plotly isn't that great of software. I created this graph: And I want to make the lines…
Suliman Sharif
  • 607
  • 1
  • 9
  • 26