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.2.tar.gz (447.0 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.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: figctx-0.1.2.tar.gz
  • Upload date:
  • Size: 447.0 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.2.tar.gz
Algorithm Hash digest
SHA256 7f912a663a9706d539074305145f310b8bc142f96a4b355e1909034bf759dee2
MD5 ba7ce290c415d7084286157227ecd72d
BLAKE2b-256 4d1be9b42d5b94e325e16771fe1cdedc48dc0d80a83f5e287a118f6cbdfed15b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: figctx-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b23faf8f62a59c117b731b551098f1d89da47bbae230879d8b776d4f5b67a11
MD5 53350cd248d624d04f5c7aab78d9851a
BLAKE2b-256 a1654851dae4f4c3594d95920ca79b672717ad1b1744b7223c2ba3ce7e3e4acb

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