Skip to content

Instantly share code, notes, and snippets.

@cmrivers
Created December 11, 2015 19:50
Show Gist options
  • Save cmrivers/fffeca0c96468164aa66 to your computer and use it in GitHub Desktop.
Save cmrivers/fffeca0c96468164aa66 to your computer and use it in GitHub Desktop.
#Hah now you're getting down into the weeds. This bit of code should put in commas. If you want it to be the y axis, make sure to change the get_xaxis to get_yaxis
ax.get_xaxis().set_major_formatter(matplotlib.ticker.FuncFormatter(lambda x, p: format(int(x), ',')))
#and for colors, the seaborn color palette magic only works if you are using seaborn to plot. Since you're using matplotlib, which is lower level, you'll have to do it like this:
colors = sns.color_palette('husl', 5) #change 5 to however many thigns you are plotting
ax.plot(blah, blah, color=colors[0])
ax.plot(blah, blah, color=colors[1])
#If you want to change the markercolor I think instead of "color" you do "markercolor"
#Here is the documentation for all the things you can change in the matplotlib plots: http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment