numpy
NumPy is a general-purpose array-processing package designed to efficiently manipulate large multi-dimensional arrays of arbitrary records without sacrificing too much speed for small multi-dimensional arrays.
Sample histogram
From http://bespokeblog.wordpress.com/2011/07/11/basic-data-plotting-with-matplotlib-part-3-histograms/
SlackBuilds
numpy
Package 32 bit: numpy-1.6.2-i486-1_SBo.tgz
Package 64 bit: numpy-1.6.2-x86_64-1_SBo.tgz
pytz
Package 32 bit: pytz-2012h-i486-1_SBo.tgz
Package 64 bit: pytz-2012h-x86_64-1_SBo.tgz
python-dateutil
1 su
2 cd /tmp
3 wget http://slackbuilds.org/slackbuilds/14.0/python/python-dateutil.tar.gz
4 tar xvzf python-dateutil.tar.gz
5 cd python-dateutil
6 wget http://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.1.tar.gz
7 ./python-dateutil.SlackBuild
8 installpkg /tmp/python-dateutil-2.1-i486-1_SBo.tgz
Package 32 bit: python-dateutil-2.1-i486-1_SBo.tgz
Package 64 bit: python-dateutil-2.1-x86_64-1_SBo.tgz
six
Package 32 bit: six-1.3.0-i486-1_SBo.tgz
Package 64 bit: six-1.4.1-x86_64-1_SBo.tgz
pysetuptools
1 su
2 cd /tmp
3 wget http://slackbuilds.org/slackbuilds/14.0/python/pysetuptools.tar.gz
4 tar xvzf pysetuptools.tar.gz
5 cd pysetuptools
6 wget https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.8.tar.gz
7 ./pysetuptools.SlackBuild
8 installpkg /tmp/pysetuptools-0.9.8-i486-1_SBo.tgz
Package 32 bit: pysetuptools-0.8-i486-1_SBo.tgz
Package 64 bit: pysetuptools-0.9.8-x86_64-1_SBo.tgz
matplotlib
Package 32 bit: matplotlib-1.1.1-i486-1_SBo.tgz
Package 64 bit: matplotlib-1.1.1-x86_64-1_SBo.tgz
In windows
- pip install numpy
- pip install matplotlib
Simple plot
simple_plot.py
1 # python3 simple_plot.py
2 import matplotlib.pyplot as plt
3 import numpy as np
4 # Data for plotting
5 start=0.0
6 end=2.0
7 step=0.01
8 x_axis = np.arange(start, end, step) # <class 'numpy.ndarray'>
9 y_axis = 1 + np.sin(2 * np.pi * x_axis) # <class 'numpy.ndarray'>
10 image, window = plt.subplots()
11 window.plot(x_axis, y_axis)
12 window.set(xlabel='x', ylabel='sin(2*pi*x)',
13 title='Sin wave from 0 to 2')
14 window.grid()
15 image.savefig("test.png")
16 plt.show()