graphr is a small language written to create basic mathematical graphs. It is an interpreted language written in python and essentially wraps the matplotlib library using a simple syntax. Heavily inspired by vmem!
Firstly install matplotlib and numpy
pip install matplotlib numpy
Then clone the repo
git clone https://github.com/swishyy/graphr.git your-project-name
Then run the interpreter and pass a .graphr file with it
cd your-project-name
python interepreter.py file.grapr
$ - Allows for comments.
TOOLBAR HIDE/SHOW
- Hide or show the toolbar when the graph is rendered. Ommiting this command shows the toolbar by default.
WARNINGS HIDE/SHOW
- Hide or show warnings in the console when the graph is rendered. Ommiting this command shows the commands by default.
e.g. TITLE This is a title
- Sets the title of the graph.
e.g. EQUATION x^2 5
- Creates the equation for the graph. Each term must have a space between it and must be in terms of x only.
e.g. RANGE -5 5
- Sets the boundaries for the x-axis on the graph.
e.g. COLOUR blue
- Set the colour of the line. If a colour is not picked, one will be randomly assigned.
e.g. SCREENSHOT graph
- Screenshots the graph and saves it with the filename specified.
e.g. SHOW
- Simply displays the graph, without this command the graph would not be displayed.
OPTIONS TOOLBAR HIDE
OPTIONS WARNINGS HIDE
$this is a comment
TITLE Example Graph
EQUATION x 1
RANGE -5 5
COLOUR blue
SCREENSHOT graph1
SHOW
All pull requests are welcome let me know if there are any bugs.