prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Correctly handle data values <= 0 on a log scale
  This is a continuation from issue #5389, partially adressed by PR #5477.  There persists an issue where negative data is not handled correctly.  All data <= 0 should be discarded before generating the plot.
  
  As is, if `values = np.linspace(-0.1, 0.9), a JS error complains that it "could not set initial ranges", probably because `log(n)` for `n<=0` is not defined.
  
  </issue>
  <code>
  [start of sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py]
  1 from bokeh.plotting import figure, output_file, show
  2 
  3 x = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]
  4 y = [10**xx for xx in x]
  5 
  6 output_file("log.html")
  7 
  8 # create a new plot with a log axis type
  9 p = figure(plot_width=400, plot_height=400,
  10            y_axis_type="log", y_range=(10**-1, 10**4))
  11 
  12 p.line(x, y, line_width=2)
  13 p.circle(x, y, fill_color="white", size=8)
  14 
  15 show(p)
  16
  [end of sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py b/sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py
  --- a/sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py
  +++ b/sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py
  @@ -6,8 +6,7 @@
   output_file("log.html")
   
   # create a new plot with a log axis type
  -p = figure(plot_width=400, plot_height=400,
  -           y_axis_type="log", y_range=(10**-1, 10**4))
  +p = figure(plot_width=400, plot_height=400, y_axis_type="log")
   
   p.line(x, y, line_width=2)
   p.circle(x, y, fill_color="white", size=8)
  
verification_info: {"golden_diff": "diff --git a/sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py b/sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py\n--- a/sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py\n+++ b/sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py\n@@ -6,8 +6,7 @@\n output_file(\"log.html\")\n \n # create a new plot with a log axis type\n-p = figure(plot_width=400, plot_height=400,\n-           y_axis_type=\"log\", y_range=(10**-1, 10**4))\n+p = figure(plot_width=400, plot_height=400, y_axis_type=\"log\")\n \n p.line(x, y, line_width=2)\n p.circle(x, y, fill_color=\"white\", size=8)\n", "issue": "Correctly handle data values <= 0 on a log scale\nThis is a continuation from issue #5389, partially adressed by PR #5477.  There persists an issue where negative data is not handled correctly.  All data <= 0 should be discarded before generating the plot.\r\n\r\nAs is, if `values = np.linspace(-0.1, 0.9), a JS error complains that it \"could not set initial ranges\", probably because `log(n)` for `n<=0` is not defined.\n", "before_files": [{"content": "from bokeh.plotting import figure, output_file, show\n\nx = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]\ny = [10**xx for xx in x]\n\noutput_file(\"log.html\")\n\n# create a new plot with a log axis type\np = figure(plot_width=400, plot_height=400,\n           y_axis_type=\"log\", y_range=(10**-1, 10**4))\n\np.line(x, y, line_width=2)\np.circle(x, y, fill_color=\"white\", size=8)\n\nshow(p)\n", "path": "sphinx/source/docs/user_guide/examples/plotting_log_scale_axis.py"}]}