Skip to content

Tag: plotly

How to show data by day in a Plotly chart

I have a dataframe with the number of people vaccinated per day and I’m trying to put this data in a daily bar chart of Plotly, but it aggregates the data every about 13 days. I don’t want the aggregated view this way, I need it to show the bars per day. Below is a part of the dataframe and

Python interactive plotting with click events

I’m currently trying to bring in some data through np, do some processing on that initial data, plot it, but then be interactive with my plot. Plotly has a tutorial of how to take the plot and change the color of the data points (in jupyter using the click event https://plotly.com/python/click-events/).…

Map of a country with plotly

The aim of create a map of a country with plotly. I show you the code to make the map with dots from cities and I want to change it to regions: In the scope we have by default: “world” | “usa” | “europe” | “asia” | “africa” | “north america&#82…

Multiple color argument in plotly in python

My objective is make a bar plot in plotly. I did I get I want Type A & Type B to have different colors, and preferable additional separate legend. I tried: but this gives error. Answer Using color to illustrate two different dimensions of your data would, in my opinion, quickly become very confusing. Unle…

How to customize plotly legend order?

I want to change the ordering of legend in my boxplot from 1-12, or perhaps even renaming them to Jan, Feb, etc. Any idea how could I do it? Answer px.box is plotting your data in the order that it’s reading through your DataFrame df, so you can pass a sorted DataFrame to px.box instead: If you want the…

Combine DateRangePicker and Dropdown in Plotly Dash

I’m trying to use DateRangePicker and Dropdown to callback a dash_table. Actually I tried to call dropdown option first and then call dash_table after calling options, but it didn’t work. I don’t know how to add a second call back that is based on dropdown options. Below is my code: Answer Y…