Mpl Is Just Fine

Mar 18, 2018 - 1 minutes
I’ve been using matplotlib for nearly 5 years at least once a week. I’m still learning things that exist within the pylab interface… not the most ideal UX. For instance, I just learned about plt.axvline, which I could use to draw vertical lines in my code instead of what I usually use, plt.vlines(coordinate_list, *plt.gca().get_ylim()), but it’s not as general as plt.vlines since it actually plots a rectangle. Still, though, for most of what I do (which is a single vertical line for drawing specific axes/time breaks in a plot) it’s easier. Read more ...

on jbp

Mar 15, 2018 - 6 minutes
This discussion by Nathan Robinson of Current Affairs is a must read. Like usual, I think Nathan’s exactly right. But first, a little personal digression. None of this is about statistics or data science at all, so if you’re here for that, feel free to tune out. This past year has been a personal & professional whirlwind for me. Over its course, I broke up with my long-term girlfriend, sold/donated nearly everything I owned, moved to Brooklyn to work for CARTO while finishing my dissertation, got back with my girlfriend long distance from Brooklyn, applied to (and got) a tenure-track job in the UK, then finished my dissertation, moved to the UK, defended my dissertation, and returned here to try and stop my head from spinning. Read more ...

Annoscatter

Mar 12, 2018 - 1 minutes
I found this function super useful in my dissertation and more generally in my work. What it does is take x,y coordinates and a set of strings and annotates a scatterplot using those labels. For example, here’s a figure from my dissertation where I use it to annotate a plot of regression leverage by year. I jitter the points a little to provide legibility to the text labels, but basically it’s just a call like annoscatter(df. Read more ...