2

I am attempting to create a line graph with an inverted y-axis. The y-axis I was hoping to create would have a maximum value of 1 (top) and a minimum axis value of 5 (bottom).

I have not been able to find how to perform this operation in the Bokeh documentation.

Any help that anyone could provide would be greatly appreciated.

Stuart Berg
  • 17,026
  • 12
  • 67
  • 99
moe_95
  • 397
  • 2
  • 17
  • 1
    Possible duplicate of https://stackoverflow.com/questions/40317898/reverse-axis-in-python-bokeh? – rcriii Jun 17 '19 at 18:54

1 Answers1

4

If you are using the default auto-ranging DataRange1d, you can set:

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
bigreddot
  • 33,642
  • 5
  • 69
  • 122