🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

scilayout

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scilayout

Create axes from top left of figure in centimetres to simplify scientific figure generation.

pipPyPI
Version
0.1.2
Maintainers
1

Pepy Total Downloads Coverage Status EffVer Versioning

What is scilayout?

[!WARNING]
This package is in beta.

pip install scilayout

Scilayout is a Python package to make creating multi-panel scientific figures easier, faster, and maybe a little bit more fun. The core idea is to build figures using coordinates in centimetres from the top left using interactive plotting. This approach has a few main benefits:

  • The iterative process of building figures up from scratch is easier.
  • Complex layouts can be interchanged more easily.
  • Exported figure sizes are explicitly stated (in centimetres) for seamless embedding in documents.

There are many guides for Matplotlib styling for scientific publication, and there are a number of packages that make this process easier (e.g. SciencePlots), but this scilayout supports the creation of figures which are 100% ready for embedding in documents.

import scilayout
fig = scilayout.figure()  # it's a matplotlib figure like plt.figure()

myax = fig.add_panel((1, 1, 5, 5))  # creates a panel with position specified in cm

# %%
myax.set_location((2, 10, 5, 3), method='size')  # move the panel after it's been created and set it's location and dimensions based on size (5x3cm dimensions from 2cm down and 10 cm left)

This package is designed for people with:

  • A basic understanding of matplotlib's Axes object and how to work with it (rather than only using plt, the differences described here)
  • A desire to produce figures entirely in code (example approaches described in blogposts from brushingupscience.com and dendwrite.substack)

Keywords

matplotlib-figures

FAQs

Did you know?

Socket

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.

Install

Related posts