Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notebook: inline option without pylab #2672

Closed
lamortenera opened this issue Dec 10, 2012 · 8 comments
Closed

notebook: inline option without pylab #2672

lamortenera opened this issue Dec 10, 2012 · 8 comments
Milestone

Comments

@lamortenera
Copy link

Hi all,
I was wondering if it is possible to use the notebook inline mode without using the pylab option (because it annoys me to have so many variables already defined, i prefer to import the numpy and the matplotlib.pyplot namespaces manually).
Thank you!

Bye,
Alessandro

@Carreau
Copy link
Member

Carreau commented Dec 10, 2012

You can set pylab_import_all config flag to false. It should help.
Le 10 déc. 2012 11:01, "lamortenera" notifications@github.com a écrit :

Hi all,
I was wondering if it is possible to use the notebook inline mode without
using the pylab option (because it annoys me to have so many variables
already defined, i prefer to import the numpy and the matplotlib.pyplot
namespaces manually).
Thank you!

Bye,
Alessandro


Reply to this email directly or view it on GitHubhttps://github.com//issues/2672.

@lamortenera
Copy link
Author

Sorry but i'm really a newbie with ipython, I tried to follow your suggestion, which I assumed it translates in newbie language into this:

  1. I created an ipython profile with the name "myProfile"
  2. I tweaked the file ipython_notebook_config.py so that the variable pylab_import_all config is set to false
  3. I started the notebook with the command: ipython notebook --profile myProfile

Like this it does not work, but issuing the command "ipython notebook --profile myProfile --pylab inline"works!!

  1. It would be neat to put every option into ipython_notebook_config.py instead of half and half, so that I can just call "ipython notebook --profile myProfile" is it possible?
  2. It looks to me counter-intuitive that we need to use the pylab option but additionally tell ipython to not import the libraries, what does the pylab option do then? And why is it not independent from the "inline" option?

Thank you very very much anyway!!

@Carreau
Copy link
Member

Carreau commented Dec 10, 2012

Hi,

Sorry for the brevity of the first response it was from my phone. --pylab=inline is equivalent to c.IPKernelApp.pylab = 'inline' in your config file. Changing the config files in profile_default folder allows you to just do ipython notebook, which is even simpler.

The import question comes from time to time, but one of the important reason why we keep the current behavior of --pylab is for backward compatibility. Is is true that the --pylab became almost only associated to in people mind with inline figures or not. Even if at the beginning Pylab goal is to unify API and weaken inconsistencies between APIs.

@lamortenera
Copy link
Author

Thank you very much, everything works now!! (even if I would made the inline option independent from pylab, something like --inline)

@minrk
Copy link
Member

minrk commented Dec 13, 2012

  1. It looks to me counter-intuitive that we need to use the pylab option but additionally tell ipython to not import the libraries, what does the pylab option do then?

Pylab's primary purpose is not imports, but integration. It does three things:

  1. set the matplotlib backend
  2. hook up with eventloop associated with that backend (if any).
  3. user-space imports (optional)

The user-space imports are just sugar, which you can disable if you want, and the eventloop integration can be done separately with %gui. Step 1. is the core of %pylab.

And why is it not independent from the "inline" option?

Because --pylab inline means "use IPython inline figures as the matplotlib backend" (step 1. above). An --inline command that doesn't do anything associated with matplotlib wouldn't actually do anything at all.

@lamortenera
Copy link
Author

I see, thank you very much. The reason why I thought it would be a good idea to have an --inline option independent from pylab is that I use the notebook also for writing R code, and --inline applies also to R plots. I don't see why R plots should have anything to do with pylab, and if they do because of the implementation, I think the user of the notebook should not be aware of it. But that's just philosophy/bullshit. Thank you!

@ellisonbg
Copy link
Member

I think all of the R plotting will work fine without pylon inline.

Sent from my iPad

On Dec 14, 2012, at 3:22 AM, lamortenera notifications@github.com wrote:

I see, thank you very much. The reason why I thought it would be a good idea to have an --inline option independent from pylab is that I use the notebook also for writing R code, and --inline applies also to R plots. I don't see why R plots should have anything to do with pylab, and if they do because of the implementation, I think the user of the notebook should not be aware of it. But that's just philosophy/bullshit. Thank you!


Reply to this email directly or view it on GitHub.

@minrk
Copy link
Member

minrk commented Jan 19, 2013

@lamortenera, @ellisonbg is correct, the --inline options does not affect the R plots. It exclusively affects matplotlib.
The 100% only reason to use --pylab inline is to get inline matplotlib figures by default.

closing.

@minrk minrk closed this as completed Jan 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants