Questions tagged [plotly-python]

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

References:

2059 questions
6
votes
1 answer

Plotly: How to change line style using px.line?

I have dataframe tha tlooks similar to this: >>>Hour Level value 0 7 H 1.435 1 7 M 3.124 2 7 L 5.578 3 8 H 0.435 4 8 M 2.124 5 8 L 4.578 I want to create line…
Reut
  • 1,555
  • 4
  • 23
  • 55
6
votes
1 answer

Plotly: How to set up a color palette for a figure created with multiple traces?

I using code below to generate chart with multiple traces. However the only way that i know to apply different colours for each trace is using a randon function that ger a numerico RGB for color. But random color are not good to presentations. How…
Caio Euzébio
  • 182
  • 1
  • 1
  • 10
6
votes
2 answers

update specific subplot axes in plotly

Setup: I'm tring to plot a subplots with plotly library, but can't figure out how to reference a specific subplots' axis to change its' name (or other properties). In Code 1 I show a simple example where I add two plots one on thop of the other…
Michael
  • 2,167
  • 5
  • 23
  • 38
6
votes
1 answer

How to annotate difference between bars?

I'm trying to show difference between bars using annotation. Specifically, showing difference between all bars with respect to the first bar. My code is shown below: import plotly.graph_objects as go lables = ['a','b','c'] values =…
whtitefall
  • 631
  • 9
  • 16
6
votes
1 answer

Change hover text of a plotly express treemap

I want to show in a treemap just the label and value of each item, not parent or ID. I have defined it with plotly express. No matter how much I have tinkered with it, I haven’t been able to restrict hover text to the fields I need. Check the code…
6
votes
2 answers

Plotly: How to add a horizontal scrollbar to a plotly express figure?

I'm beginning to learn more about plotly and pandas and have a multivariate time series I wish to plot and interact with using plotly.express features. I also want my plot to a horizontal scrollbar so that the initial plot is for a pre-specified…
fishbacp
  • 1,123
  • 3
  • 14
  • 29
6
votes
1 answer

"new text" label randomly appearing in Plotly graph

I have built a graph using networkx and thereafter visualized it using plotly as described in the official guide. However, I get a random "new text" label in the graph for no apparent reason. This label doesn't appear in one particular zone of the…
Bendemann
  • 735
  • 11
  • 31
6
votes
1 answer

Python Plotly: How to add an image to a 3D scatter plot

I am trying to visualize multiple 2d trajectories (x, y) in a 3D scatter plot where the z axis is time. import numpy as np import pandas as pd import plotly.express as px # Sample data: 3 trajectories t = np.linspace(0, 10, 200) df =…
Marcos
  • 695
  • 9
  • 22
6
votes
1 answer

How to center vertically and horizontally a heading text using dash-bootstrap

I'm using Bootstrap dash layout for my web application layout. But instead of having the text at the top of the page, I wish the text will be in the red area. How can I achieve it? I've tried using "align":"center" and "justify":"center" but…
Ralph Deint
  • 380
  • 1
  • 4
  • 15
6
votes
2 answers

Plotly: how to make an unbounded vertical line in a subplot?

The goal is to get vertical infinite lines in every subplot, at x=1. In this example, I'll just try a single plotly shape of type="line" in the first row, first column from plotly.subplots import make_subplots import plotly.graph_objects as…
Halogen II
  • 117
  • 1
  • 8
6
votes
1 answer

How to efficiently plot a large number of line shapes where the points are connected two by two?

I need to plot a very large number of segments with plotly. Contrary to a regular scatter plot where all points can be connected, here I need to only connect points two by two. I considered different options: adding line shapes to the plot;…
Cedric H.
  • 7,980
  • 10
  • 55
  • 82
6
votes
3 answers

Change subplots title position/orientation in Plotly Python

I need to change subplot title in python plotly, namely, rotate it by 90 degrees. I tried hard but without any success. Here is my code import plotly.offline as pyo import plotly.graph_objs as go from plotly import tools trace1 = go.Bar( x=[1,…
Okroshiashvili
  • 3,677
  • 2
  • 26
  • 40
6
votes
1 answer

Plotly: How to set values for major ticks / gridlines for timeseries on x-axis?

Background: This question is related, but not identical, to Plotly: How to retrieve values for major ticks and gridlines?. A similar question has also been asked but not answered for matplotlib here: How do I show major ticks as the first day of…
vestland
  • 55,229
  • 37
  • 187
  • 305
5
votes
2 answers

How can I reverse direction of Plotly's Colorbar, so that small values at top and large values at bottom

I'm currently using the colorbar on plotly to indicate the depths at which underwater SONAR receivers have been placed. Currently, the colorbar looks like this: However, I think it would make more sense if the bigger values, which indicate greater…
user1245262
  • 6,968
  • 8
  • 50
  • 77
5
votes
3 answers

How to update figure in same window dynamically without opening and redrawing in new tab?

I am creating a 3D scatter plot based off a pandas dataframe, and then I want to re-draw it with slightly updated data whenever the user presses a button in my program. I almost have this functionality working, except the updated figure is drawn via…
JDS
  • 16,388
  • 47
  • 161
  • 224