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
- su
- cd /tmp
wget http://slackbuilds.org/slackbuilds/14.0/development/numpy.tar.gz
- tar xvzf numpy.tar.gz
- cd numpy
wget http://freefr.dl.sourceforge.net/project/numpy/NumPy/1.6.2/numpy-1.6.2.tar.gz
./numpy.SlackBuild
- installpkg /tmp/numpy-1.6.2-i486-1_SBo.tgz
Package 32 bit: numpy-1.6.2-i486-1_SBo.tgz
Package 64 bit: numpy-1.6.2-x86_64-1_SBo.tgz
pytz
- su
- cd /tmp
wget http://slackbuilds.org/slackbuilds/14.0/python/pytz.tar.gz
- tar xvzf pytz.tar.gz
- cd pytz
wget https://launchpad.net/pytz/main/2012h/+download/pytz-2012h.tar.bz2
./pytz.SlackBuild
- installpkg /tmp/pytz-2012h-i486-1_SBo.tgz
Package 32 bit: pytz-2012h-i486-1_SBo.tgz
Package 64 bit: pytz-2012h-x86_64-1_SBo.tgz
python-dateutil
- su
- cd /tmp
wget http://slackbuilds.org/slackbuilds/14.0/python/python-dateutil.tar.gz
- tar xvzf python-dateutil.tar.gz
- cd python-dateutil
wget http://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.1.tar.gz
./python-dateutil.SlackBuild
- 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
- su
- cd /tmp
wget http://slackbuilds.org/slackbuilds/14.0/python/six.tar.gz
- tar xvzf six.tar.gz
- cd six
wget http://pypi.python.org/packages/source/s/six/six-1.4.1.tar.gz
./six.SlackBuild
- installpkg /tmp/six-1.4.1-i486-1_SBo.tgz
Package 32 bit: six-1.3.0-i486-1_SBo.tgz
Package 64 bit: six-1.4.1-x86_64-1_SBo.tgz
pysetuptools
- su
- cd /tmp
wget http://slackbuilds.org/slackbuilds/14.0/python/pysetuptools.tar.gz
- tar xvzf pysetuptools.tar.gz
- cd pysetuptools
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.8.tar.gz
./pysetuptools.SlackBuild
- 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
- su
- cd /tmp
wget http://slackbuilds.org/slackbuilds/14.0/libraries/matplotlib.tar.gz
- tar xvzf matplotlib.tar.gz
- cd matplotlib
wget http://downloads.sourceforge.net/matplotlib/matplotlib-1.1.1.tar.gz
./matplotlib.SlackBuild
- installpkg /tmp/matplotlib-1.1.1-i486-1_SBo.tgz
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
- python3 -m venv plotEnv
- source plotEnv/bin/activate
- pip install --upgrade pip
- pip install numpy matplotlib pyqt5
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()