##// END OF EJS Templates
Merge pull request #1529 from drtimcouper/master...
Merge pull request #1529 from drtimcouper/master Implement new configurable flag to control tab completion on modules that implement the __all__ attribute: IPCompleter.limit_to__all__= Boolean. Instruct the completer to use __all__ for the completion Specifically, when completing on ``object.<tab>``. When True: only those names in obj.__all__ will be included. When False [default]: the __all__ attribute is ignored.

File last commit:

r2564:bfd3d6a4
r6486:47367a06 merge
Show More
example-gnuplot.py
36 lines | 1017 B | text/x-python | PythonLexer
#!/usr/bin/env python
"""
Example code showing how to use Gnuplot and an embedded IPython shell.
"""
from Numeric import *
from IPython.numutils import *
from IPython.Shell import IPShellEmbed
# Arguments to start IPython shell with. Load numeric profile.
ipargs = ['-profile','numeric']
ipshell = IPShellEmbed(ipargs)
# Compute sin(x) over the 0..2pi range at 200 points
x = frange(0,2*pi,npts=200)
y = sin(x)
# In the 'numeric' profile, IPython has an internal gnuplot instance:
g = ipshell.IP.gnuplot
# Change some defaults
g('set style data lines')
# Or also call a multi-line set of gnuplot commands on it:
g("""
set xrange [0:pi] # Set the visible range to half the data only
set title 'Half sine' # Global gnuplot labels
set xlabel 'theta'
set ylabel 'sin(theta)'
""")
# Now start an embedded ipython.
ipshell('Starting the embedded IPython.\n'
'Try calling plot(x,y), or @gpc for direct access to Gnuplot"\n')
#********************** End of file <example-gnuplot.py> *********************