Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/346.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在不更改颜色的情况下更改x轴标签的度数?_Python_R_Ggplot2_Rpy2 - Fatal编程技术网

Python 在不更改颜色的情况下更改x轴标签的度数?

Python 在不更改颜色的情况下更改x轴标签的度数?,python,r,ggplot2,rpy2,Python,R,Ggplot2,Rpy2,我有一个脚本可以生成以下图形: 这很简单: p = ggplot2.ggplot(nb_islands_df) + ggplot2.aes_string(y='times_seen', x='other_timepoint') + ggplot2.geom_bar(stat="identity") + ggplot2.facet_grid(ro.Formula('nb_timepoints ~ main_island')) + ggplot2.theme(**

我有一个脚本可以生成以下图形:

这很简单:

p = ggplot2.ggplot(nb_islands_df) +
    ggplot2.aes_string(y='times_seen', x='other_timepoint') +
    ggplot2.geom_bar(stat="identity") +
    ggplot2.facet_grid(ro.Formula('nb_timepoints ~ main_island')) 
    + ggplot2.theme(**{"axis.text.x": ggplot2.element_text(angle=90, vjust=1)})
除了一件事:当我更改文本的角度时,它也会将x轴文本的颜色更改为黑色

如何恢复原始颜色或避免在第一时间更改颜色?我知道我可以在上面的最后一行添加颜色选项,但是我应该在上面添加什么颜色呢


如果有几个答案,我会接受解释为什么会发生这种情况的答案。但我认为这只是一个bug。

如果这是一个bug,可能是rpy2中的bug,因为我无法直接在R中重现这种行为。@baptiste我以为他们只是在声称添加
主题(axis.text.x=element\u text(angle=90,vjust=1))
实际上导致了颜色变为黑色,巴蒂斯特:这听起来像是我的答案。将颜色设置为“灰色50”。如果回答得当,我会投赞成票。还请添加关于在哪里可以找到这样的源代码片段的信息?@joran我同意,我没有测试就得出了结论。它按预期工作,在R中,我不知道什么会导致python出现问题。@unfuncat
theme\u grey
显示为默认主题设置的所有值。