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

Uploaded Python 3

File details

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

File metadata

  • Download URL: figctx-0.1.1.tar.gz
  • Upload date:
  • Size: 447.1 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.1.tar.gz
Algorithm Hash digest
SHA256 45fcaca065f6d4b6aa2b362231aecb48ee04c7d5a65caea4079b340828267cd3
MD5 74a5f9f1862f41146fe07b1f44dcee46
BLAKE2b-256 e4705c3a2cfd6e0416d939575717ba4d23d39bdfee74b74c50ed3ff81616fa12

See more details on using hashes here.

File details

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

File metadata

  • Download URL: figctx-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 07c9b00df44d0491a8238edda1b94018815090a2120823d020a40e8b5c1ff5e0
MD5 d221d275b179510f3cbae9d3c81151f6
BLAKE2b-256 a3f8418841e269e27cf1220177f0fcc7e847239a557040f4c857b5fda3acdfc3

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