Skip to main content

Figure context manager for QuiME Lab

Project description

Figctx - Figure Context for QuiME

This Package helps you to conveniently make figures with QuiME template

How to install

pip install figctx

Example1 (single figure context)

import numpy as np
import figctx as ctx

testdata = np.random.rand(2,100)

with ctx.single(80, 60, './example.png') as (fig,ax):
        
    ax.scatter(testdata[0], testdata[1], label='data')
    ax.set_title('title')

Example Single Figure

Example2 (multi figure context)

import numpy as np
import figctx as ctx

testdata = np.random.rand(2,100)
testdata[0] = np.sort(testdata[0])

with ctx.multi(70, 150, 2, 1, [1], [1,2], './example2.png') as (fig, subfig):

    c = subfig[0]
    
    ax = c.subplots(1,1)
    ax.tick_params(
            direction='in',
            width=1,
            length=3,
            pad=2
        )
    ax.plot(testdata[0], 2*testdata[1]+1, label='Test1')

    temp = np.random.rand(100)
    ax.plot(testdata[0], temp, label='Test2')

    temp = np.random.rand(100)
    ax.plot(testdata[0], 1.5*temp+0.5, label='Test3')

    ax.legend()
    ax.set_title('ax title1')

    ax.set_xlabel('x')
    ax.set_ylabel('y')

    c.suptitle('fig suptitle1')

    c = subfig[1]

    axes = c.subplots(1,2)
    for ax in axes:
        ax.tick_params(
            direction='in',
            width=1,
            length=3,
            pad=2
        )
    
    ax = axes[0]

    ax.plot(testdata[1], testdata[0])
    ax.set_title('ax title2')

    ax = axes[1]

    ax.scatter(testdata[0], 0.5*testdata[1], label='Test3', color='black')
    ax.scatter(2*testdata[1], 0.5*testdata[0], label='Test4')
    ax.set_title('ax title3')

    ax.legend()

    c.suptitle('fig suptitle2')

    fig.suptitle('Suptitle')

Example Multi Figure

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

figctx-0.1.0.tar.gz (446.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

figctx-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file figctx-0.1.0.tar.gz.

File metadata

  • Download URL: figctx-0.1.0.tar.gz
  • Upload date:
  • Size: 446.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for figctx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dd3cb79e03ceb8b65449bf917c6d956d6e4796d84e1f161840df6327b528d74f
MD5 3c0745a114191f1e2200f85fde2dc762
BLAKE2b-256 9e52733d4c41cf04e2393569867cea6a1cadb5988f237605af1f4b60e77f6f78

See more details on using hashes here.

File details

Details for the file figctx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: figctx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for figctx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fff6d4d2c77ab7e710b4a024d99549e774b231df59ecbd05174d1e1d7acd179c
MD5 708b800489b6d04c07fa1dd2f93310f0
BLAKE2b-256 5bdfbed67270215cd234aec71621c82f5a95f8984fe32e8735aaf26bf673f518

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page