A simple interpreted language for creating basic mathematical graphs.

Overview

graphr

Introduction

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!

Installation

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

Language

$ - Allows for comments.

OPTIONS

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.


TITLE

e.g. TITLE This is a title - Sets the title of the graph.

EQUATION

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.

RANGE

e.g. RANGE -5 5 - Sets the boundaries for the x-axis on the graph.

COLOUR

e.g. COLOUR blue - Set the colour of the line. If a colour is not picked, one will be randomly assigned.

SCREENSHOT

e.g. SCREENSHOT graph - Screenshots the graph and saves it with the filename specified.

SHOW

e.g. SHOW - Simply displays the graph, without this command the graph would not be displayed.

Example Program

OPTIONS TOOLBAR HIDE
OPTIONS WARNINGS HIDE

$this is a comment

TITLE Example Graph
EQUATION x 1
RANGE -5 5
COLOUR blue
SCREENSHOT graph1
SHOW

Contributing

All pull requests are welcome let me know if there are any bugs.

License

MIT

You might also like...
Generate knowledge graphs with interesting geometries, like lattices
Generate knowledge graphs with interesting geometries, like lattices

Geometric Graphs Generate knowledge graphs with interesting geometries, like lattices. Works on Python 3.9+ because it uses cool new features. Get out

Python ts2vg package provides high-performance algorithm implementations to build visibility graphs from time series data.
Python ts2vg package provides high-performance algorithm implementations to build visibility graphs from time series data.

ts2vg: Time series to visibility graphs The Python ts2vg package provides high-performance algorithm implementations to build visibility graphs from t

 Flame Graphs visualize profiled code
Flame Graphs visualize profiled code

Flame Graphs visualize profiled code

Mapomatic - Automatic mapping of compiled circuits to low-noise sub-graphs

mapomatic Automatic mapping of compiled circuits to low-noise sub-graphs Overvie

Kglab - an abstraction layer in Python for building knowledge graphs
Kglab - an abstraction layer in Python for building knowledge graphs

Graph Data Science: an abstraction layer in Python for building knowledge graphs, integrated with popular graph libraries – atop Pandas, RDFlib, pySHACL, RAPIDS, NetworkX, iGraph, PyVis, pslpython, pyarrow, etc.

Handout for the tutorial
Handout for the tutorial "Creating publication-quality figures with matplotlib"

Handout for the tutorial "Creating publication-quality figures with matplotlib"

A tool for creating Toontown-style nametags in Panda3D

Toontown-Nametag Toontown-Nametag is a tool for creating Toontown Online/Toontown Rewritten-style nametags in Panda3D. It contains a function, createN

A python wrapper for creating and viewing effects for Matt Parker's christmas tree.

Christmas Tree Visualizer A python wrapper for creating and viewing effects for Matt Parker's christmas tree. Displays py or csv effect files and allo

A Python Binder that merge 2 files with any extension by creating a new python file and compiling it to exe which runs both payloads.
A Python Binder that merge 2 files with any extension by creating a new python file and compiling it to exe which runs both payloads.

Update ! ANONFILE MIGHT NOT WORK ! About A Python Binder that merge 2 files with any extension by creating a new python file and compiling it to exe w

Owner
console.log("my repos live here");
null
A Python library created to assist programmers with complex mathematical functions

libmaths was created not only as a learning experience for me, but as a way to make mathematical models in seconds for Python users using mat

Simple 73 Oct 2, 2022
Mathematical learnings with Lean, for those of us who wish we knew more of both!

Lean for the Inept Mathematician This repository contains source files for a number of articles or posts aimed at explaining bite-sized mathematical c

Julian Berman 8 Feb 14, 2022
Draw interactive NetworkX graphs with Altair

nx_altair Draw NetworkX graphs with Altair nx_altair offers a similar draw API to NetworkX but returns Altair Charts instead. If you'd like to contrib

Zachary Sailer 206 Dec 12, 2022
Draw interactive NetworkX graphs with Altair

nx_altair Draw NetworkX graphs with Altair nx_altair offers a similar draw API to NetworkX but returns Altair Charts instead. If you'd like to contrib

Zachary Sailer 156 Feb 6, 2021
Generate graphs with NetworkX, natively visualize with D3.js and pywebview

webview_d3 This is some PoC code to render graphs created with NetworkX natively using D3.js and pywebview. The main benifit of this approac

byt3bl33d3r 68 Aug 18, 2022
BGraph is a tool designed to generate dependencies graphs from Android.bp soong files.

BGraph BGraph is a tool designed to generate dependencies graphs from Android.bp soong files. Overview BGraph (for Build-Graphs) is a project aimed at

Quarkslab 10 Dec 19, 2022
By default, networkx has problems with drawing self-loops in graphs.

By default, networkx has problems with drawing self-loops in graphs. It makes it hard to draw a graph with self-loops or to make a nicely looking chord diagram. This repository provides some code to draw self-loops nicely

Vladimir Shitov 5 Jan 6, 2022
Personal IMDB Graphs with Bokeh

Personal IMDB Graphs with Bokeh Do you like watching movies and also rate all of them in IMDB? Would you like to look at your IMDB stats based on your

null 2 Dec 15, 2021
A D3.js plugin that produces flame graphs from hierarchical data.

d3-flame-graph A D3.js plugin that produces flame graphs from hierarchical data. If you don't know what flame graphs are, check Brendan Gregg's post.

Martin Spier 740 Dec 29, 2022
Here are my graphs for hw_02

Let's Have A Look At Some Graphs! Graph 1: State Mentions in Congressperson's Tweets on 10/01/2017 The graph below uses this data set to demonstrate h

null 7 Sep 2, 2022