This is part 2 of the matplotlib introduction. The material in classes 15 and 16 is covered in a video:
reload wander
dir, m = wander.wander_list('2011-10-11.gga.dat.bz2')
cla()
plot dirErrr… dir runs -180 to +180. Let’s make that 0..360:
dir360 = [ d if d>0 else d+360 for d in dir ]Didn’t get that last line? I’ll explain it more in a video.
It would be nice to be able to make a figure with multiple plots and maybe have a histogram. Let’s try making a histogram first.
cla()
hist(m)
hist(m, bins=30)
hist(m, bins=100)Which is a reminder that you are warned that histograms are not a stable concept. How they look depends heavily on the number of bins.
Warning: matplotlib is designed to follow how matlab does plotting. That means that subplots start counting from 1, not 0. Bummer.
cla()
subplot (411)
plot(dir360)
plot(x)
subplot (412)
plot(y)
subplot (413)
plot(m)
subplot (414)
hist(m, bins=200)We can start building up capabilities
zeros(30)
ones(10)
concatonate( (zeros(100), ones(100), zeros(100) ) )- What is “interactive mode” for matplotlib?
- Switching figures
- Splitting 15 into 15 & 16