Created
August 1, 2013 19:40
-
-
Save yuwash/6134540 to your computer and use it in GitHub Desktop.
Simple ASCII Plotter usage examples, 1-D (some discrete points) and 2-D (sin([0,2pi])) each
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" @file plot-examples.py | |
@brief ASCII-Plotter examples | |
@details Example usage of | |
[ASCII-Plotter](https://pypi.python.org/pypi/ASCII-Plotter/1.0), | |
with 1-D and 2-D examples each; | |
Currently you can obtain the aplotter.py file by | |
Imri Goldberg from | |
http://www.algorithm.co.il/blogs/ascii-plotter/ | |
@author [Yushin Washio](https://github.com/yuwash) | |
@date 2013 | |
@copyright GNU GPL 3, see http://www.gnu.org/licenses/gpl.html | |
""" | |
import aplotter, math | |
print('****** Sin([0,2pi]) ******') | |
scale=0.1 | |
n=int(2*math.pi/scale) | |
plotx=[scale*i for i in xrange(n)] | |
ploty=[math.sin(scale*i) for i in xrange(n)] | |
aplotter.plot(plotx,ploty) | |
print('****** Some discrete data sequence ******') | |
data=[ord(c) for c in 'ASCII Plotter example'] | |
aplotter.plot(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output (Rev 1):