更改图例中的图例

问题描述 投票:1回答:1

我对一个拼盘情节中的图例有疑问。

import pandas as pd
import numpy as np
from pandas.api.types import CategoricalDtype
from plotnine import *
from plotnine.data import mpg
%matplotlib inline


c= pd.read_excel("cenpv.xlsx")
c.head()


dodge_text = position_dodge(width=0.9)

(ggplot(c, aes(x='exon', y='mean'))
 + geom_bar(stat='identity', position='dodge', show_legend=False)
 + geom_text(aes(label='percentage'),                                   
             position=dodge_text,
             size=8, va='bottom', format_string='{}%')
 + geom_hline(aes(yintercept = "Overall mean", color="Overall mean")))

我希望图例只会出现一条带有标签整体平均值的黄线。可以更改吗?

plot in plotnine

python ggplot2 plotnine
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.