简体   繁体   English

倒置y轴valyes-散景

[英]Invert y-axis valyes - Bokeh

I am attempting to create a line graph with an inverted y-axis. 我正在尝试创建一个具有反向y轴的折线图。 The y-axis I was hoping to create would have a maximum value of 1 (top) and a minimum axis value of 5 (bottom). 我希望创建的y轴的最大值为1(顶部),最小轴值为5(底部)。

I have not been able to find how to perform this operation in the Bokeh documentation. 我无法在Bokeh文档中找到如何执行此操作。

Any help that anyone could provide would be greatly appreciated. 任何人都可以提供的任何帮助将不胜感激。

If you are using the default auto-ranging DataRange1d , you can set: 如果使用默认的自动调整范围DataRange1d ,则可以设置:

p.y_range.flipped = True

Or if you want to set bounds explicitly, you can when the figure is made: 或者,如果要显式设置边界,则可以在制作图形时进行:

p = figure(..., y_range=(max, min)) # min/max inverted here

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM