plotly-python

How to set the format of the marginal graph in dash plotly?

How to set the format of the marginal graph in dash plotly? Question: I have a scatterplot with a marginal_y subgraph made with: fig = px.scatter(df_filtrada, x=df_filtrada.index, y=pto, marginal_y = "violin") When I update some properties of the main graph such as the background color it affects the background of the marginal subgraph as well …

Total answers: 1

Table with subcolumns under go.Table and go.Figure

Table with subcolumns under go.Table and go.Figure Question: I am having trouble on making a table for a dash dashboard go.Figure() using go.Table() (I am open to other suggestions) that has different number of columns inside one, as for example: |Column 1 | Column 2 | |Sub C.1|Sub C.2| Sub C.1| Sub C.2| | data1 …

Total answers: 1

How to target a specific trace in pie chart by name when using update_traces() selector attribute?

How to target a specific trace in pie chart by name when using update_traces() selector attribute? Question: The idea is to change the hover template only in the "Resto" trace. Here is a reproducible example: df_stack = pd.DataFrame({"Country": [‘Brasil’,’China’,’Estados unidos’,’Chile’,’India’,’Paises bajos’,’Vietnam’,’Peru’,’Corea, republica de’,’Indonesia’,’Resto’], "Dolars": [11599.42961799,7671.6791054099995,6198.81430321,4578.07,4153.13352132,3352.11349841,2998.44092833,2247.29957849,1968.7549113200002,1890.7284090800001,35635.107780379985], "Pct_change":[0.0846110761489467,0.2953716769009316,0.41561413372310074,0.21787800280514857,0.09245460739576772,0.18325289020293622,0.023857445957433443,0.2555960957383905,0.2319776811635097,0.12068329801455069,0.0] }) fig = go.Figure(data=[go.Pie(labels=df_stack["Country"], values=df_stack[‘Dolars’], hole=.5, customdata = np.transpose([df_stack["Pct_change"], …

Total answers: 1

Adding a secondary y axis on heatmap in plotly express python

Adding a secondary y axis on heatmap in plotly express python Question: i would like to add a second y axis to my plotly express heatmap, but unfortunately i can’t do it and just can’t find any infos. already tried stuff like that: Plotly: How to plot on secondary y-Axis with plotly express short code …

Total answers: 1

How to make Plotly Pie charts the same size always

How to make Plotly Pie charts the same size always Question: I’m generating different Pie charts that have legends of different lengths. The problem is that when the legend is long, the Pie chart is smaller, I’d like to make the Pie chart always the same size. This is my code: pie_chart = go.Pie(labels=labels, values=y) …

Total answers: 2

Create a treemap showing directory structure with plotly graph object

Create a treemap showing directory structure with plotly graph object Question: I want to create a treemap that shows the folders in a given directory, including all subfolders and files using plotly.graph_objects.Treemap. I understand simple examples like this one and this one. Problem: I can’t figure out how to generate the ids column to make …

Total answers: 2

get ploty.graph_objects.Volume to only show the surface of the Volume

get ploty.graph_objects.Volume to only show the surface of the Volume Question: I am using plotly to plot some simple Volumes, like in the code below. import plotly.graph_objects as go import numpy as np X, Y, Z = np.mgrid[-3:3:10j, -5:5:10j, -1:1:3j] values = np.random.randint(100, size=300) fig = go.Figure(go.Volume(x=X.flatten(), y=Y.flatten(), z=Z.flatten(), value=values.flatten(), opacity=1, surface_count=21)) fig.show() This results …

Total answers: 1

add color to markers with plotly python

add color to markers with plotly python Question: How can I change marker’s color based on the z array? The colors can be anything but need differ if value of z is differ! i understand that plotly express can do it, but i need to use plotly graph objects I try to add a color=z …

Total answers: 1