3

I am trying to use both seaborn and matplotlib defaults to create plots in an ipython notebook, each plot with it's own default mpl or sns style. I have followed the instructions outlined in this question, and this one, however they don't quite do what I need.

%matplotlib inline
import matplotlib.pyplot as plt
plt.plot([1,2,3,4], [1,4,9,16])

enter image description here

import seaborn as sns
plt.plot([1,2,3,4], [1,4,9,16])

enter image description here

sns.reset_orig()
plt.plot([1,2,3,4], [1,4,9,16])

enter image description here

The last plot saves without the grey border, however the size is still different than the original. And the inline display is not the same as the original. Ideally I would like to be able to set the style on a per plot basis. Does anyone have any suggestions on how to achieve this?

Community
  • 1
  • 1
johnchase
  • 13,155
  • 6
  • 38
  • 64
  • You could try importing `seaborn.apionly` and then using context managers to control the style for individual plots. I'm not sure why reseting to the matplotlib "orig" params doesn't work in the notebook. – mwaskom Aug 28 '15 at 16:55
  • 1
    Is this http://stackoverflow.com/questions/26413185/how-to-recover-matplotlib-defaults-after-setting-stylesheet one helpful? – CT Zhu Aug 28 '15 at 20:00

0 Answers0