Working on PS 12 and everything is going fine, but I can't find a way to make my histograms for problem 5&6 look nice. I want the histograms from the different delays to be scaled in the same way so that they are easily comparable. Any suggestions on how this could be accomplished? Thanks!
use the normed = True argument? http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.hist
Normed just adjusts the histograms y axis so that it shows probability rather than number, which is fine, but not the problem I'm encountering. The problem is that with a longer delay, often the virus population never ends in remission so the x-axis autoscale just shows stuff around 1000. I'd like all of the graphs to have the same x-axis, essentially. I've tried using: pylab.xticks(range(0,1200,50),range(0,1200,50)) and/or pylab.xlim(0,1200) which gives basically the effect I want except that for some reason final populations of 0 don't show up on the histogram (it looks like they're just smushed on the edge-picture attached)
start the x-axis at -1? I've always just used matplotlib, not pylab - does pylab set/get axes parameters?. maybe the pyplot.axis() scaled argument or x/y min/max arguments would work http://matplotlib.sourceforge.net/api/pyplot_api.html?highlight=xmin#matplotlib.pyplot.axis set them dynamically based on the data? or set_xlim http://matplotlib.sourceforge.net/api/axes_api.html?highlight=set_xlim#matplotlib.axes.Axes.set_xlim http://matplotlib.sourceforge.net/examples/api/histogram_demo.html?highlight=hist i haven't used it for a while but when i started trying to fine tune and make plots dynamic, it seemed easier working directly with the 'artists' - but then i never tried using pylab, which is supposed to make things easier
Solved it! Switching to matplotlib doesn't appear to make any difference. adjusting to xlim(-50,1200) still displayed the 0s as a single line. It looks like the issue is that all of the items have the same value so the bar is super thin. I provided a list for bins so that it clumps them in 50s and it made the bar thick. Thanks for your help
Join our real-time social learning platform and learn together with your friends!