olgabot / prettyplotlib

Painlessly create beautiful matplotlib plots.
olgabot.github.io/prettyplotlib
MIT License
1.69k stars 148 forks source link

Python 2.7: with ppl.pretty fails #73

Closed dpq closed 10 years ago

dpq commented 10 years ago
import prettyplotlib as ppl
with ppl.pretty:
  pass

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: __exit__
olgabot commented 10 years ago

Which version are you using? From PyPI or from github?


Olga Botvinnik PhD Program in Bioinformatics and Systems Biology Gene Yeo Laboratory http://yeolab.ucsd.edu/yeolab/Home.html | Sanford Consortium for Regenerative Medicine University of California, San Diego www http://olgabotvinnik.com | blog http://blog.olgabotvinnik.com/ | github http://github.com/olgabot | twitter http://twitter.com/olgabot | linkedin http://www.linkedin.com/in/olgabotvinnik

2014-06-23 7:26 GMT-07:00 David Parunakian notifications@github.com:

import prettyplotlib as ppl with ppl.pretty: pass

Traceback (most recent call last): File "", line 1, in AttributeError: exit

— Reply to this email directly or view it on GitHub https://github.com/olgabot/prettyplotlib/issues/73.

dpq commented 10 years ago

PyPI. However, the Github version also fails with another error (just tested):

Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import prettyplotlib as ppl

with ppl.pretty: ... pass ... Traceback (most recent call last): File "", line 1, in File "prettyplotlib/colors.py", line 45, in enter context = mpl.rc_context(rc=self.rcParams) AttributeError: 'module' object has no attribute 'rc_context'

Here we use brewer2mpl-1.4 from PyPI.

On 2014-06-23 13:02-0700, Olga Botvinnik wrote:

Which version are you using? From PyPI or from github?


Olga Botvinnik PhD Program in Bioinformatics and Systems Biology Gene Yeo Laboratory http://yeolab.ucsd.edu/yeolab/Home.html | Sanford Consortium for Regenerative Medicine University of California, San Diego www http://olgabotvinnik.com | blog http://blog.olgabotvinnik.com/ | github http://github.com/olgabot | twitter http://twitter.com/olgabot | linkedin http://www.linkedin.com/in/olgabotvinnik

2014-06-23 7:26 GMT-07:00 David Parunakian notifications@github.com:

import prettyplotlib as ppl with ppl.pretty: pass

Traceback (most recent call last): File "", line 1, in AttributeError: exit

— Reply to this email directly or view it on GitHub https://github.com/olgabot/prettyplotlib/issues/73.


Reply to this email directly or view it on GitHub: https://github.com/olgabot/prettyplotlib/issues/73#issuecomment-46894215

jankatins commented 10 years ago

That looks like a very old matplotlib version:

import matplotlib as mpl
print(mpl.__version__)

We had teh same problem in ggplot: https://github.com/yhat/ggplot/blob/master/ggplot/ggplot.py#L31

dpq commented 10 years ago

1.3.1, the latest stable release

On 2014-06-24 03:37-0700, Jan Schulz wrote:

That looks like a very old matplotlib version:

import matplotlib as mpl
print(mpl.__version__)

Reply to this email directly or view it on GitHub: https://github.com/olgabot/prettyplotlib/issues/73#issuecomment-46955949

olgabot commented 10 years ago

This is very strange! Can you print out all your python packages (pip list) and post it as a gist (https://gist.github.com/) ?

ngaloppo commented 10 years ago

I have the same problem. Also running matplotlib version 1.3.1 with Anaconda python install on Windows 7.

ngaloppo commented 10 years ago

@olgabot Here you go: https://gist.github.com/ngaloppo/3f3d10765e647a0610a8

JackStouffer commented 10 years ago

+1 I have this issue as well with matplotlib 1.4.0 and ppl 0.1.7

olgabot commented 10 years ago

Thank you for your comment. Unfortunately, I no longer have the bandwidth to maintain prettyplotlib. I recommend using seaborn. Using seaborn, to get the prettyplotlib style, do:

import seaborn as sns
sns.set(style='ticks', palette='Set2')

And to remove "chartjunk", do:

sns.despine()

If you have discrete pull requests, I will accept them, but I personally will no longer fix bugs.

If you are a biological scientist looking for ways to analyze your big-ish (20+ samples) data, check out my main project, flotilla.