cbhua / matplotlib-prefab

A collection of Matplotlib plot templates.

Home Page:https://cbhua.github.io/matplotlib-prefab/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Matplotlib Prefab is a repository based on matplotlib package, which provides several matplotlib ploting templates for line plot, hist plot, scatter plot, and some complex plottings. You can check the website at cbhua.github.io/matplotlib-prefab.

πŸ’‘ Introduction

I have a passion for creating visually appealing figures in publications. During my time writing papers, I often dedicated significant effort to crafting plots. In this repository, I've compiled some of my previous matplotlib plotting source code and have designed several templates for convenient reuse. I've chosen not to package this content due to the myriad of customizable parameters. Instead, I believe a template approach is more straightforward to modify and repurpose. I hope these templates inspire you and provide techniques to craft beautiful matplotlib figures.

βš™οΈ Environment

I've aimed to keep dependencies to a minimum; thus, a basic combination of matplotlib and numpy should suffice. However, it's important to note that I've incorporated LaTeX font families and formatting. Therefore, you'll need to have LaTeX installed on your operating system.

Python Version: 3.10 (develop)
Python Package: matplotlib 3.8 (support Latex text), numpy
Other: to use the Latex illustration style, the Latex is required to be installed

πŸ”¦ How to use

You can easily go to the website: cbhua.github.io/matplotlib-prefab and see the example figures of each prefabs:

You can click on the figure to view the associated template code. Most of the code for these figures is self-contained and can be run independently. However, a few require external data. For those instances, please refer to the accompanying notebook.

You can also refer to the notebook directory to access Jupyter notebooks for those example figures and tailor them to your needs.

πŸ”§ Structure

.
β”œβ”€β”€ css - webpage
β”œβ”€β”€ js - webpage
β”œβ”€β”€ pages - webpage
β”œβ”€β”€ vendor - webpage
β”œβ”€β”€ data - some complex figures reauqired external data
β”œβ”€β”€ fig - example figures
β”œβ”€β”€ notebook - jupyter notebook for creating figures
└── *.html - webpage

πŸ–Ό Visualization Example

Line Plots: Jupyter notebook

Hist Plots: Jupyter notebook

Scatter Plots: Jupyter notebook

Complex Examples: 3D Plots jupyter notebook, Matshow jupyter notebook

πŸ“¬ Contact

If you have any question or find any bug, feel free to raise an issue. If you have ideas to contribute to this repo, welcome to pull request or contact cbhua@kaist.ac.kr. Thanks for interested to our work!

About

A collection of Matplotlib plot templates.

https://cbhua.github.io/matplotlib-prefab/


Languages

Language:Jupyter Notebook 88.3%Language:HTML 7.9%Language:JavaScript 2.9%Language:CSS 0.9%