All Questions
23 questions
0
votes
0
answers
67
views
How to add a scrollbar to python plotly long title
I am using python plotly to create scatterplot using following function-
def show_products(products: list[ProductInfo], title: str) -> None:
layout = go.Layout(
...
0
votes
1
answer
184
views
Plotly - set decimal place in choropleth
How do you convert number 1.425887B to 1.4 in plotly choropleth ?
data2022 = dict(type = 'choropleth',
colorscale = 'agsunset',
reversescale = True,
locations = df['...
1
vote
1
answer
777
views
Switch Active Slider with Button – Plotly Python
I have been trying to show and hide plotly sliders with button presses. I have looked at the documentation and have been able to do this manually but can't seem to find the right syntax for the button ...
2
votes
1
answer
3k
views
plotly express | change tick units on y axis
I want to add units to my yaxis of my bar chart.
Im using plotly.express for that but didnt found a working solution inside the documentation.
text_auto() and fig.update_layout() are not working for ...
1
vote
0
answers
539
views
Responsive Text in Plotly
I'm working on a dash app and trying to account for different screen sizes by using responsive text in plotly.
This is somewhat similar to this question: Using Multiple Font Sizes in Plotly Chart ...
1
vote
1
answer
683
views
Plotly - how to format x-axis datetime to a custom format [12AM = 12a]?
I'm trying to change the format of my datetime x-axis ticks to be a specific custom format that matches the rest of my company's formatting.
using fig.update_xaxes(tickformat='%-I %p') I can get to a ...
0
votes
2
answers
3k
views
Python Plotly - number format in hovertemplate with if...else
I would like to format the numbers in the hovertemplate according to their height like this:
2 decimal places if the number is under 10,
1 decimal place if the number is under 100,
0 decimal places ...
2
votes
1
answer
437
views
Plotly sunburst chart timedelta field in values ends with scientific notation
When creating a sunburst chart I want to have a timedelta sum values seen when moving cursor into a part of chart (field 'time' below). Field is type timedelta64[ns]. Works fine with sum aggregations ...
1
vote
1
answer
522
views
Tickval does not assign correct position to ticktext
I am plotting an annotated heatmap with a colour bar using the code below, inspired in part by this very helpful tutorial (its part of a larger bit of code which I'll put at the end).
final_df is a ...
1
vote
0
answers
715
views
How to add label name to hoverlabel in Plotly parallel category plot?
I want to add the label name to the respective hoverlabels. Eg- The hoverlabel in the image that reads %{label} should instead read Workplace Closing and so on.
There is no custom_data or text ...
1
vote
0
answers
1k
views
How to prevent overlap of labels in Plotly parallel category plot?
The labels on the top are overlapping with each other. From what I have found till now, there is no built in solution for this. I am however trying to find a workaround for the same. I have already ...
5
votes
1
answer
3k
views
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 ...
0
votes
1
answer
787
views
Plotly: Display date in specified format in hoverlabel (customdata reading date as string)
import pandas as pd
from pandas import Timestamp
import plotly.express as px
df = pd.DataFrame({'continent': {127: 'South America',
128: 'South America'},
'date': {127: Timestamp('2021-03-01 00:00:...
0
votes
1
answer
53
views
Plotly x-axis formating
Is there a way to the show annual dates on the xaxis of a python plotly plot. Right now it seems that there are too many ticks which form this dark bar at the bottom. Thanks in advance.Plot
1
vote
1
answer
621
views
Plotly: Remove extra blank space from hoverlabel
import plotly.express as px
df = px.data.stocks()
fig = px.line(df, x='date', y=['GOOG','AAPL'])
fig.update_traces(hovertemplate=None)
fig.update_layout(hovermode='x unified', yaxis_title=None, xaxis=...