所有assignment相关链接:
Coursera | Applied Plotting, Charting & Data Representation in Python(University of Michigan)| Assignment1
Coursera | Applied Plotting, Charting & Data Representation in Python(University of Michigan)| Assignment2
Coursera | Applied Plotting, Charting & Data Representation in Python(University of Michigan)| Assignment3
Coursera | Applied Plotting, Charting & Data Representation in Python(University of Michigan)| Week3 Practice Assignment
Coursera | Applied Plotting, Charting & Data Representation in Python(University of Michigan)| Assignment4
有时间(需求)就把所有代码放到github上
Practice Assignment: Understanding Distributions Through Sampling
第三周Optional的pratice,做不做都可以,不做也可以直接去看看其他做了人的代码,学习下。
难度不大不小,主要是读懂题,然后考animation。
有个问题折腾了我很久,希望有知道的小伙伴解答。a = animation.FuncAnimation(fig, update, interval=100)
这里,貌似只能用a = ...
,其他的变量名,比如simulation
b
等都不行,都会造成动画效果不停止,一直运行下去,尝试了很久,还是找不到原因 :(
欢迎评论区提出建议~
** This assignment is optional, and I encourage you to share your solutions with me and your peers in the discussion forums! **
To complete this assignment, create a code cell that:
- Creates a number of subplots using the
pyplot subplots
ormatplotlib gridspec
functionality. - Creates an animation, pulling between 100 and 1000 samples from each of the random variables (
x1
,x2
,x3
,x4
) for each plot and plotting this as we did in the lecture on animation. - Bonus: Go above and beyond and “wow” your classmates (and me!) by looking into matplotlib widgets and adding a widget which allows for parameterization of the distributions behind the sampling animations.
Tips:
- Before you start, think about the different ways you can create this visualization to be as interesting and effective as possible.
- Take a look at the histograms below to get an idea of what the random variables look like, as well as their positioning with respect to one another. This is just a guide, so be creative in how you lay things out!
- Try to keep the length of your animation reasonable (roughly between 10 and 30 seconds).
1 | import matplotlib.pyplot as plt |
1 | import matplotlib.pyplot as plt |
1 | import matplotlib.pyplot as plt |