Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
MPLLayout is a package used to create figure layouts for matplotlib using geometric constraints.
MPLLayout can be used to:
Matplotlib contains several strategies for creating figure layouts (for example, GridSpec
and subplots
for grid-based layouts).
These strategies work well, however, they can be insufficient for complex figures or if you want precise placement of figure elements.
To address this, this package uses geometric primitives and constraints to represent and position figure elements.
It consists of:
Quadrilateral
primitive represents a figure, a Point
represents a text anchor, etc.),Collinear
constraints align lines, Length
constraints fix line lengths, etc.),You can install the package from PyPI using
pip install matplotlib-layout
Alternateively, clone the repository into a local drive. Navigate to the project directory and run
pip install .
The package requires numpy
, matplotlib
, and jax
.
The tutorial notebook in examples/tutorial.ipynb
demonstrates the basic usage of the package and explains some of the commonly used geometric constraints.
Other examples are also given in the examples
folder.
The notebook at examples/ten_simple_rules_demo.ipynb
contains an interactive demo to recreate figures from "Ten Simple Rules For Better Figures" (Rougier, Droettboom and Bourne 2014).
A summary of how to use the package is shown in the figure below. The process resembles creating and constraining geometry in computer-aided design programs like AutoCAD, SolidWorks, etc.
This project is a work in progress so there are likely bugs and missing features. If you would like to contribute a bug fix, a feature, refactor etc. thank you! All contributions are welcome.
A similar project with a geometric constraint solver is pygeosolve
.
There is also another project prototype for a constraint-based layout engine for matplotlib
MplLayouter
, although it doesn't seem active as of 2023.
FAQs
A package for laying out figures with geometric constraints
We found that matplotlib-layout demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.