That plot renders exactly as I would expect it to. The locations that things get drawn is determined by:
- the data *values*
- axis orientation (default x-axis always increases to the right)
The *order* you provide the data is irrelevant. A point at (5, 7) get drawn where the axis range dictates that (5,7) is located. If you the axis range to be reversed from its normal direction, you'll have to ask for that:
import numpy as np
from bokeh.plotting import figure, show, output_file
output_file("example.html")
r = figure()
r.x_range.flipped = True # NOTE HERE
x = [5,4,3,2,1]
y = [7,8,9,10,11]
r.line(x,y)
show(r)
If you are expecting the *order* you provide the data to be meaningful, perhaps you are really wanting to use some kind of categorical axis?
Thank you. I see what you mean. I wanted the flipped functionality. And yes I will want to use a categorical axis as well. Is there a way to specify the axis orientation or a categorical axis? I am guessing this is using factors?
···
On Tuesday, January 10, 2017 at 4:43:14 PM UTC-5, javbo wrote:
import numpy as np
from bokeh.plotting import figure, show, output_file
output_file(“example.html”)
r = figure()
x = [5,4,3,2,1]
y = [7,8,9,10,11]
r.line(x,y)
show(r)
Bokeh version 12.4 . Python 3.5
The output shows x values in ascending order (rather than descending) with their corresponding y values.
Does anyone know why bokeh is not respecting the order of the input for the x-axis? Am I doing something wrong?