Note
Go to the end to download the full example code.
SeqLogo#
SeqLogo is for plotting sequence logo.
from marsilea.plotter import SeqLogo
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
matrix = pd.DataFrame(data=np.random.randint(1, 10, (4, 10)), index=list("ACGT"))
_, ax = plt.subplots()
colors = {"A": "r", "C": "b", "G": "g", "T": "black"}
SeqLogo(matrix, color_encode=colors).render(ax)

Total running time of the script: (0 minutes 0.259 seconds)