✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
📊 Dash 2.0 is Arriving. Register here.

Time series plots for each groub for each year

Hi, Newbie here,
I have some problem deciding what kind of plot to use and how
Here’s a glimpse of my dataset

I want to plot the total votes each party has got for each year.
I’m confused which plot to choose and how to make it.
any help would be useful for me.

Here’s an example of the similar output I’m looking for

Thank you

Hi @bharatk101,

From looking at your data and the plot, I’m not sure I understand what the x-axis and the width of the distributions represent.

If you want to show total vote count per party per year you could use a grouped bar chart (https://plot.ly/python/bar-charts/#grouped-bar-chart), with year on the x-axis, count on the y-axis, and a separate bar trace for each group.

Or if you want to emphasize the continuity across years, you could use a line plot (https://plot.ly/python/line-charts/#simple-line-plot) with year on the xaxis, vote count on the y axis, and a separate line trace per group.


1 Like

hi @jmmease thank you for writing back.
the problem with grouped bar chart is that there are at-lest 10-15 parties for each state and I’m looking for a efficient way to plot these.
I’m looking for a similar solution as in the figure and I don’t need that slider.
can you think of anything that would make it efficient to plot these

Hi @bharatk101,

In your plot above, what does the x-axis mean? And what does the width of each spike mean?


x-axis for year, y-axis for totvorpoll

But the xaxis spikes range from ~-800 to ~3000 while the years range from 1996 to 2015.


Here’s what I got after digging around, I used bubbly to get this done, I wanted something like this but with bar.