Questions tagged [plotly-python]

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

References:

2059 questions
7
votes
3 answers

Plotly - How to set width to specific line?

I'm trying to draw a graph with plotly libraries and I want to set a specific width of each line. This is my code. x_link = [125, 257, None, 125, 787, None] y_link = [383, 588, None, 383, 212, None] z_link = [65, 85, None, 65, 526, None] link_size…
Kaow
  • 483
  • 2
  • 9
  • 22
7
votes
1 answer

How to disable plotly express from grouping bars based on color?

I have a pandas dataframe with 3 columns: name, group, value. I wanted to make a horizontal bar chart with plotly that is sorted from highest to lowest value and color each bar based on their value in the group column. The problem is that when I add…
Asad Rauf
  • 743
  • 9
  • 17
7
votes
1 answer

Persistent plotly plots in jupyter notebooks

My jupyter notebooks that have plotly plots do not retain the plots between sessions. This is running on a Singularity container based on the official jupyter/datascience-notebook docker image with plotly pip installed on top. I am using the new…
7
votes
2 answers

Using numerical values in plotly for creating Gantt-Charts

I want to create interactive Gantt-Charts (or a sequence chart) for displaying the scheduling of tasks on multiple processors. I found the library plotly, which produced very good and interactive Gantt-charts. Unfortunately, plotly-Gantt only works…
RoQuOTriX
  • 2,871
  • 14
  • 25
7
votes
1 answer

How to cluster Gantt bars without overlap?

Using create_gantt I have overlapping start and end dates: import plotly.plotly as py import plotly.figure_factory as ff import plotly df = [dict(Task="Milestone A", Start='2017-01-01', Finish='2017-02-02', Resource='Jack'), …
Ayon Dey
  • 71
  • 1
  • 3
7
votes
2 answers

Succint way to add line segments to plotly graph (with python/jupyter notebook)?

I want to create a lollipop plot with several horizontal line segments like this - https://python-graph-gallery.com/184-lollipop-plot-with-2-group. I'd like to use plotly since I prefer the graphics (and easy interactivity) but can't find a succint…
Hebe Hilhorst
  • 323
  • 3
  • 8
7
votes
1 answer

Plotly: How to make stacked bar chart from single trace?

Is it possible to have two stacked bar charts side by side each of them coming from a single column? Here's my df: Field Issue Police Budget cuts Research Budget cuts Police Time consuming Banking Lack of support Healthcare …
user8322222
  • 489
  • 3
  • 14
  • 28
6
votes
1 answer

Plotly Python update figure with dropMenu

i am currently working with plotly i have a function called plotChart that takes a dataframe as input and plots a candlestick chart. I am trying to figure out a way to pass a list of dataframes to the function plotChart and use a plotly dropdown…
smith
  • 200
  • 3
  • 12
6
votes
2 answers

How do I display bar plot for values that are zero in plotly?

How do I make the bar appear when one of the value of y is zero? It just leaves a gap by default. Is there a way I can enable it to plot for zero values? I am able to see a line on the x-axis at y=0 for the same if just plotted using go.Box. I would…
MissionAstro
  • 93
  • 1
  • 5
6
votes
1 answer

How to show text on a heatmap with Plotly?

I am trying to show the z items as text on a Plotly heatmap. I am using the latest version (5.5.0) and following the exact example shown on the Plotly Heatmaps webpage (https://plotly.com/python/heatmaps/), see the section "Text on Heatmap Points"…
K-83Rick
  • 123
  • 2
  • 9
6
votes
0 answers

show labels of a sunburst chart outside of the circle

I'm trying to draw a sunburst chart, but some items are too small to be visible. ex : this code... fig =go.Figure(go.Sunburst( labels=[ "Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"], parents=["", "Eve", …
6
votes
2 answers

How To Create Subplots Using Plotly Express

If you’re like me, you love Plotly Express, but were frustrated when you ran into the issue that figures returned by Express can’t utilize ‘make_subplots()’ since make_subplots takes in traces and not figures. With this post, I’d like to share my…
mmarion
  • 859
  • 8
  • 20
6
votes
1 answer

Plotly: How to set colorbar position for a choropleth map?

I can't find anything in the documentation about controlling where to place the colorbar, just whether or not it should be shown and with what color scale, etc. Can this be done? If it helps, I am implementing my choropleth map with Dash.
mdeverna
  • 322
  • 3
  • 9
6
votes
3 answers

Plotly: Bar chart opacity changes with longer time range

I noticed that plotting different time scales causes the opacity of my overlaid bar chart to fade. How do I correct this? In the first image, I plotted over a range of 2 years and in the second I plotted a 1 year time range. Notice that the former…
0xCourtney
  • 83
  • 1
  • 9
6
votes
2 answers

Custom hovertemplate for plotly express heatmap

I'm trying to use plotly.express in python to generate a heatmap from a pandas dataframe with a custom hover template that includes additional variables. So for example: import pandas as pd import plotly.express as px df = pd.DataFrame({'A': [10,…
Tim Herzog
  • 505
  • 1
  • 5
  • 11