Skip to content

Commit

Permalink
Add notes about fixing the Anaconda install, "pylab inline" for chart…
Browse files Browse the repository at this point in the history
…s (thx @stevenfarlie)
  • Loading branch information
projectgus committed Jun 11, 2013
1 parent 6c3fbd3 commit e464fc7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
12 changes: 12 additions & 0 deletions core/charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ title: Creating Charts

So far we haven't done anything to really explore IPython Notebook's features, but now we're going to use the library *matplotlib* to create some graphical charts based on our data.

## Inline Charts

Start by running the following snippet in an IPython Notebook cell:

%pylab inline

... this tells IPython Notebook that you want charts to be shown "inline" inside your notebook.

NB: You can also specify this on the command line by launching notebook with the arguments "--pylab inline"

## Simple Example

Here's an example of a simple chart:

import matplotlib.pyplot as plt
Expand Down
21 changes: 19 additions & 2 deletions core/notebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ We recommend you download and install [Anaconda](http://continuum.io/downloads.h

Anaconda comes with its own version of Python 2.7, IPython Notebook, other libraries like matplotlib, and a package manager ("conda") that you can use to install other packages or other Python versions.

## Anaconda Install on Windows

Anaconda version 1.5.0 has a couple of installer bugs. After the install you'll need to do a couple of things to fix them:

* Go to your "Documents" folder and create a new folder called "IPython Notebooks". This is the working directory for IPython Notebook, and is where your notebooks will be created.

* Go to the Start Menu, find the shortcut icon for "IPython (Py 2.7) Notebook", right-click it and then choose Properties.

(On Windows 8 you'll need to first click "Open File Location", then right-click the shortcut again to select the Properties.)

In the "Start In" field, remove the duplicate double quote marks "" from the start and end of the line:
<img src="../images/windows_fixing_startdir.png" alt="Windows with messed up Start Dir selection">
</img>

...replace these with a single double quote " at each end.

## Alternative Options

**Skip this section if you're happy with Anaconda.**
Expand Down Expand Up @@ -136,9 +152,10 @@ When IPython Notebook starts up it prints a line like this:

This is the directory that it was started from, and it's the working directory so if you type a line like `%run "myprogram.py"` it will look for the file "myprogram.py" in that directory.

It can be helpful to make sure this directory is the directory where you plan to keep files related to your work - otherwise you have to type the complete path to the file each time so Python can find it.
Using Anaconda on Windows this directory is the "IPython Notebooks" directory that we created after we ran the installer.

It can be helpful to make sure this directory is the directory where you plan to keep files related to your work. If you're launching from the command line, you can 'cd' to this directory before you launch Notebook.

Installers like 'Anaconda' will add IPython Notebook to your system path, which means you can run it from any working directory. If you open a command line terminal and `cd` to the directory you want, you can then run `ipython notebook --pylab inline` to start IPython Notebook from inside the correct working directory.

## Other IPython tips

Expand Down
Binary file added images/windows_fixing_startdir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e464fc7

Please sign in to comment.