Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding text inside each arc in a circle #26

Open
DeepaMahm opened this issue Nov 2, 2022 · 0 comments
Open

Adding text inside each arc in a circle #26

DeepaMahm opened this issue Nov 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@DeepaMahm
Copy link

DeepaMahm commented Nov 2, 2022

Hello @ponnhide,

I'm trying to plot a circos diagram (like the one here) using pycircos.

I tried to do the first arc following the tutorials. I am trying to understand how to add text in each arc.

Code:

import pandas as pd
import pycircos
import matplotlib.pyplot as plt

Garc = pycircos.Garc
Gcircle = pycircos.Gcircle

d = {
    'A': ['study1', 'study2', 'study3'],
    'B': ['study1', 'study4', 'study5'],
    'C': ['study1', 'study2']
}

circle = Gcircle(figsize=(8, 8))
# add keys
for name in d.keys():
    print(name)
    arc = Garc(arc_id=name, interspace=0, raxis_range=(935, 985), labelposition=80, label_visible=True)
    circle.add_garc(arc)
circle.set_garcs(-65, 245)
for arc_id in circle.garc_dict:
    circle.tickplot(arc_id, raxis_range=(985, 1000), tickinterval=20000000, ticklabels=None)
circle.figure
circle.figure.savefig("test.png")

Plot:

enter image description here

I would like to add text (i.e. values stored in d, the keys are the arcs) to each arc in the next level circle or inside each arc in the current circle. Example figure is available here.

Suggestions on how to do this will be of great help.

Thanks a lot for the wonderful library!

@ponnhide ponnhide added the enhancement New feature or request label Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants