Comments (2)
Hi @gbouras13,
pyCirclize is a matplotlib-based library, so you can basically take advantage of matplotlib text styles.
As far as I know, in matplotlib you can set italic text like below.
from pycirclize import Circos
from pycirclize.utils import fetch_genbank_by_accid
from pycirclize.parser import Genbank
# Download `NC_002483` E.coli plasmid genbank
gbk_fetch_data = fetch_genbank_by_accid("NC_002483")
gbk = Genbank(gbk_fetch_data)
# Initialize Circos instance with genome size
circos = Circos(sectors={gbk.name: gbk.range_size})
circos.rect(r_lim=(90, 100), fc="lightgrey", ec="none", alpha=0.5)
sector = circos.sectors[0]
# Plot forward strand CDS
f_cds_track = sector.add_track((95, 100))
f_cds_feats = gbk.extract_features("CDS", target_strand=1)
f_cds_track.genomic_features(f_cds_feats, plotstyle="arrow", fc="salmon", lw=0.5)
# Plot reverse strand CDS
r_cds_track = sector.add_track((90, 95))
r_cds_feats = gbk.extract_features("CDS", target_strand=-1)
r_cds_track.genomic_features(r_cds_feats, plotstyle="arrow", fc="skyblue", lw=0.5)
# Plot title with all italic (use style="italic")
circos.text("Escherichia coli K-12 plasmid F (all italic)", size=14, r=10, deg=0, style="italic")
# Plot title with partial italic (use ${text}$)
circos.text("${Escherichia}$ ${coli}$ K-12 plasmid F (partial italic)", size=14, r=10, deg=180)
circos.savefig("result.png")
result.png
Reference:
https://stackoverflow.com/questions/8376335/styling-part-of-label-in-legend-in-matplotlib
from pycirclize.
This is legendary @moshi4. Works a treat even when I pass the title from a command line argument. Thanks so much once again.
George
from pycirclize.
Related Issues (20)
- Phylogenetic leaf labels with spaces are truncated HOT 2
- Arrows HOT 2
- Some modifications in my link circos HOT 9
- Is there a way to plot shapes on tracks? HOT 5
- Issue with ZeroDivisionError in Circos Plot HOT 2
- Is there any way to integrate between heatmap data and tree leaves? HOT 3
- Confused with bar plot HOT 2
- Enable wrapping/bending the text around a circle HOT 1
- Track Heatmap cmap Customization HOT 2
- cannot import name 'SimpleLocation' from 'Bio.SeqFeature' HOT 1
- figuresize HOT 1
- Massive size on save to svg - vectors of sector borders and some other lines have tons of nodes HOT 1
- Doubt regarding pycircilize HOT 3
- How to use vmin argument in `track.line()` method HOT 1
- Question: Linear tree visualization HOT 2
- Highlight different gene functioins with different tick/label colors and jitter labels HOT 1
- Custom color for genomic features HOT 2
- Set different axis scales in the radar chart HOT 5
- how to adjust overlap label by bend line like circlize HOT 1
- Rounding issue in sector.py HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycirclize.