Advertisement
bolverk

eyal_golan.py

Dec 29th, 2021
1,417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. import numpy
  2. import pylab
  3.  
  4. pylab.rcParams['font.size'] = 16
  5.  
  6. x_list = numpy.array(range(2002,2022))
  7. eg_age = x_list - 1971
  8. pylab.plot(x_list, eg_age, linewidth=4, label='EG')
  9.  
  10. wives = [{'name':'IL',
  11.           'age at marriage':20,
  12.           'year married':2002,
  13.           'year divorced':2008},
  14.          {'name':'RR',
  15.           'age at marriage':21,
  16.           'year married':2012,
  17.           'year divorced':2017},
  18.          {'name':'DG',
  19.           'age at marriage':21,
  20.           'year married':2020,
  21.           'year divorced':2021}]
  22. for wife in wives:
  23.   x_list = numpy.linspace(wife['year married'], wife['year divorced'])
  24.   y_list = x_list - x_list[0] + wife['age at marriage']
  25.   pylab.plot(x_list, y_list, label=wife['name'], linewidth=4)
  26. pylab.xlabel('Calendar Year')
  27. pylab.ylabel('Age [Years]')
  28. pylab.grid()
  29.  
  30. pylab.legend()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement