I try to use ggplot in Python. But I have a problem with plotting second axis on the right. Now I generate such image
with code:
(
ggplot(t, aes('app_dt', y='distr', fill='temp')) \
+ geom_col() \
+ geom_line(t, aes('app_dt', y=..., group=1), colour='red') \
+ geom_point(t, aes('app_dt', y=...), size=2, fill='white') \
+ geom_text(...) \
+ scale_y_continuous(label='percent') \
+ geom_text(aes(label=round(t['distr'] * 100, 1).astype(str) + '%'), size=7, position=position_stack(vjust=0.5)) \
+ scale_fill_brewer(palette='PuBuGn')
)
But I need something like this
So the questions are:
How I can add second axis, which values are connected with persent values in the red (blue) line?
Which function I should use to change color pallete to custom?
How I can make percent scale for axises?
Thank you in advance!