background preloader

Python

Facebook Twitter

SciPy - Graphics with Matplotlib. Matplotlib is a large and sophisticated graphics package for Python written in object oriented style. However, a layer built on top of this basic structure called pyplot accesses the underlying package using function calls. We describe a simple but useful subset of pyplot here. 4.1 Line plots 4.1.1 Simple plots Let’s type the following into Python: >>> from numpy import * >>> import matplotlib.pyplot as plt >>> x = arange(0.,10.,0.1) >>> y = sin(x) >>> ll = plt.plot(x,y) >>> plt.show() >>> The first two lines import respectively the numpy and matplotlib pyplot modules.

Calls to most pyplot functions return stuff that can sometimes be used in subsequent functions. Text such as a title, labels, and annotations can be added to the plot between the plt.plot and the plt.show commands. The resulting plot is shown in figure 4.2. 4.1.2 Multiple lines and points More complicated plots with multiple lines and line types can be made: The resulting plot is shown in figure 4.3. 4.2 Log plots and histograms. Coding style - What is a clean, pythonic way to have multiple constructors in Python. Python Tutorial.

VPython. Python Programming Language – Official Website. Data Structures and Algorithms with Object-Oriented Design Patterns in Python. Ideone.com | Online IDE & Debugging Tool >> C/C++, Java, PHP, Python, Perl and 40+ compilers and intepreters. Learn Python - Free Interactive Python Tutorial. Dive Into Python.

Thinkpython.pdf (application/pdf-objekt)