Code Monkey home page Code Monkey logo

matplotlib_templates's Introduction

Matplotlib Templates

Background

I frequently need customised graphs of functions, equations or other figures in my work as a teacher in maths and physics. With Matplotlib and Python it is possible to create almost any type of graphics in any size. The downside is that the creation process is time consuming due to the need of specify all options in the plots and the code may go long. For me, it's not something I want to start from scratch with for each plot. Therefore, I started to create templates for different kind of plots.

Simple Function Graphs

About

The code is in the file simple_function_graphs.py. Clone the project to any directory and modify the file. This is the first contribution in my suite of templates. It's a frequently used kind plot for a maths teacher, a function graph with axes intersection in origo. The code and the comments are rather self explained.

Prequesites

  • A Python 3.6 (or later) installation
  • Matplotlib installed
  • NumPy installed
  • The directory structure in this project

Matplotlib Templates is not tested in any web based framework. They may or may not work.

Optional

In order to automatically publish the plots for global access, it's built in support for Digital Ocean Spaces. This configuration demands

  • A Digital Ocean Spaces account If you have, you may want to configure your OS environment variables with * REGION_NAME, e.g. 'nyc3' * GRAPH_BUCKET, e.g. 'mygraphs' * AWS_ACCESS_KEY_ID, an ID string you get from Digital Ocean * AWS_SECRET_ACCESS_KEY, also an ID string you get from Digital Ocean
  • The Python libraries boto3 and botocoreinstalled

I think an Amazon S3 account will work too, with a slight change in the library file spacelib/tospace.py.

Sample plot

More to come...

I expect my self go further with a template for visualise statistical data visualised in bar charts, line charts and scatter plots, plots of equations of two variables and geometric figure plots.

Written with StackEdit.

matplotlib_templates's People

Contributors

nikodemusk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.