plotly-python Questions

2

Solved

When I try to import plotly.express I get the error: ImportError: Plotly express requires pandas to be installed. The installation notes did not mention having to install anything additional. I ca...
Larrikin asked 30/8, 2020 at 11:22

2

After a long search, I could not find any thread/discussion helping me to make autoscaling work with plotly. The idea would be that when I use the x-range slider to go through the data, the y-axis ...
Rhine asked 29/3, 2023 at 11:12

3

I need to make a plotly bar chart with bars ordered by value in descending order. I first order the dataframe by value in descending order. Then I use plotly.express to generate interactive bar cha...
Acolyte asked 3/11, 2019 at 5:32

1

Is there a way to lock hovertext in place when I click a datapoint? I would like to be able to click and HTML hyperlink in the text, or copy a key from the text into another system.
Unfit asked 11/5, 2020 at 22:6

4

I have imported following packages in code in my Jupyter notebook and have plotted few graphs. However, when I am uploading python file on github the graphs are not showing. I have also tried using...
Twinberry asked 31/5, 2022 at 14:5

5

In the plotly website Map Configuration and Styling in Python is described how to automatically zoom a "Geo map": import plotly.express as px fig = px.line_geo(lat=[0,15,20,35], lon=[5,1...
Bamboozle asked 8/9, 2020 at 5:29

3

Solved

I would like to create a colormap with n colors for a plotly express plot in Python, which should fade from one color into another. All the default colormaps only have 10 discrete values, but I am ...
Stranger asked 22/6, 2021 at 9:57

5

Solved

I am drawing a correlation matrix of the Titanic dataset. df_corr = df.corr() Originally, the matrix looks like this: fig = ff.create_annotated_heatmap( z=df_corr.to_numpy(), x=df_corr.columns.t...
Limp asked 25/1, 2021 at 8:48

2

Solved

As a minimum example, let's say we have next polars.DataFrame: df = pl.DataFrame({"sub_id": [1,2,3], "engagement": ["one:one,two:two", "one:two,two:one", &qu...
Vizier asked 11/3, 2024 at 20:47

7

I have never used plotly before, and I have been trying to export a sample image code to png. I have installed plotly and kaleido and ran the code on python 3, but nothing happens. #Here is the cod...
Anitaanitra asked 1/9, 2021 at 15:21

7

Solved

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?
Contradictory asked 20/1, 2020 at 0:53

7

Solved

Normally in a jupyter notebook I would use %matplotlib notebook magic to display an interactive window, however this doesn't seem to work with google colab. Is there a solution, or is it not possib...
Kinnard asked 17/10, 2018 at 16:54

3

Solved

My python code creates a plotly bar plot, but the background is white in color. I want to change it into transparent color. Is that doable? My Code: import plotly.plotly as py from plotly.graph_obj...
Pullulate asked 30/4, 2015 at 12:46

1

When I try to plot a Plotly graph, the height is set to near 0 or something, because the graph renders collapsed. What I'm seeing: However, if I manually set the graph's height, it renders correct...
Photomechanical asked 24/5, 2023 at 16:29

3

Solved

Given the following chart created in plotly. I want to add the percentage values of each count for M and F categories inside each block. The code used to generate this plot. arr = np.array([ ['Do...
Census asked 10/12, 2020 at 10:50

4

Solved

I am trying to plot a selected marker for each of my traces in plotly. I would like to assign the same color to marker and line. Is there a way how to get the color attribute of my traces? fig = g...
Sextet asked 21/4, 2020 at 21:26

3

Solved

How to use plotly.graph_objs to plot pandas data in a similar way to plotly.express - specifically to color various data types? The plotly express functionality to group data types based on a valu...
Enuresis asked 12/5, 2020 at 7:24

2

Solved

I am using heatmap from Plotly. I want to use a logarithmic scale for the color but cannot find how to do so. Here is a MWE: import plotly.graph_objects as go import numpy as np z = [[1e-4,1e-3,1e...
Conifer asked 13/7, 2021 at 20:5

2

Solved

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 exampl...
Burse asked 25/8, 2020 at 13:49

2

Solved

I would like to replace Pandas with Polars but I was not able to find out how to use Polars with Plotly without converting to Pandas. I wonder if there is a way to completely cut Pandas out of the ...
Economizer asked 4/4, 2022 at 13:9

2

Solved

How can I change the x and y-axis labels in plotly because in matplotlib, I can simply use plt.xlabel but I am unable to do that in plotly. By using this code in a dataframe: Date = df[df.Country==...

6

Solved

I have a Dataframe Date Category Sum 0 2019-06-03 "25M" 34 1 2019-06-03 "25M" 60 2 2019-06-03 "50M" 23 3 2019-06-04 "25M" 67 4 2019-06-05 "50M" -90 5 2019-06-05 "50M" 100 6 2019-06-06 "100M" 6 7 ...
Coprolite asked 19/5, 2020 at 15:52

5

Solved

How can I use Plotly to produce a line plot with a shaded standard deviation? I am trying to achieve something similar to seaborn.tsplot. Any help is appreciated.
Gymnasiarch asked 29/4, 2020 at 4:31

5

Solved

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.Dat...
Encratia asked 15/10, 2020 at 12:1

4

Solved

Plotly Express has an intuitive way to provide pre-formatted plotly plots with minimal lines of code; sort of how Seaborn does it for matplotlib. It is possible to add traces of plots on Plotly to ...
Ned asked 3/12, 2020 at 11:9

© 2022 - 2025 — McMap. All rights reserved.