Python Forum
plt.bar on two different Y axis
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
plt.bar on two different Y axis
#1
Hello,
I have this data set :
Age Var 1 Var 2
17-31 ans 19565 11178
32-44 ans 19757 24011
45-54 ans 23885 45895
55-64 ans 29622 66611
65-74 ans 36670 55734
75-84 ans 45317 28768
85 ans et plus 54347 6448

and i'd like to plot this df with the funciton plt.bar such as I obtain something like this (see attachment).

SO I would have two different Y-axis for each variable. And preferably I'd like both histograms to be generate with the function plt.bar.

I tried do hard but I can't manage to do it on matplotlib.

I thank you so much by advance for your help !

Mathis

Attached Files

Thumbnail(s)
   
Reply
#2
https://pythonguides.com/matplotlib-two-...ual%20axes.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Sample labels from excel file in order to put them on x-axis and y-axis of a plot hobbyist 11 4,394 Sep-14-2021, 08:29 AM
Last Post: hobbyist
  Difference Between Figure Axis and Sub Plot Axis in MatplotLib JoeDainton123 2 2,484 Aug-21-2020, 10:17 PM
Last Post: JoeDainton123

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020