import numpy as np

from bokeh.plotting import figure, show, output_file

N = 100

x = np.linspace(0.1, 5, N)

output_file("logplot.html", title="log axis example")

p = figure(title="log axis example",
    y_axis_type="log", y_range=[0.001, 10**22])

p.line(x, np.sqrt(x), line_dash="dotdash",
    line_color="tomato", legend="y=sqrt(x)")

p.line(x, x, legend="y=x")
p.circle(x, x, legend="y=x")

p.line(x, x**2, legend="y=x**2")
p.circle(x, x**2, fill_color=None,
    line_color="olivedrab", legend="y=x**2")

p.line(x, 10**x, line_color="gold",
    line_width=2, legend="y=10^x")

p.line(x, x**x, line_dash="dotted", line_color="indigo",
    line_width=2, legend="y=x^x")

p.line(x, 10**(x**2), line_color="coral", line_dash="dashed",
    line_width=2, legend="y=10^(x^2)")


show(p)  # open a browser

@@ -1,12 +1,13 @@
+%0A
 import numpy
@@ -72,17 +72,8 @@
 le%0A%0A
-N = 100%0A%0A
 x = 
@@ -96,64 +96,11 @@
  5, 
-N)%0A%0Aoutput_file(%22logplot.html%22, title=%22log axis example%22
+100
 )%0A%0Ap
@@ -134,20 +134,16 @@
 xample%22,
-%0A   
  y_axis_
@@ -153,16 +153,27 @@
 e=%22log%22,
+%0A          
  y_range
@@ -177,9 +177,9 @@
 nge=
-%5B
+(
 0.00
@@ -191,9 +191,9 @@
 **22
-%5D
+)
 )%0A%0Ap
@@ -218,28 +218,30 @@
 ), l
-ine_dash=%22dotdash%22,%0A
+egend=%22y=sqrt(x)%22,%0A   
     
@@ -262,32 +262,33 @@
 mato%22, l
-egend=%22y=sqrt(x)
+ine_dash=%22dotdash
 %22)%0A%0Ap.li
@@ -390,16 +390,42 @@
 x, x**2,
+ legend=%22y=x**2%22,%0A        
  fill_co
@@ -433,20 +433,16 @@
 or=None,
-%0A   
  line_co
@@ -456,33 +456,16 @@
 ivedrab%22
-, legend=%22y=x**2%22
 )%0A%0Ap.lin
@@ -471,24 +471,48 @@
 ne(x, 10**x,
+ legend=%22y=10%5Ex%22,%0A      
  line_color=
@@ -518,20 +518,16 @@
 =%22gold%22,
-%0A   
  line_wi
@@ -531,33 +531,16 @@
 _width=2
-, legend=%22y=10%5Ex%22
 )%0A%0Ap.lin
@@ -549,16 +549,39 @@
 x, x**x,
+ legend=%22y=x%5Ex%22,%0A      
  line_da
@@ -613,20 +613,16 @@
 indigo%22,
-%0A   
  line_wi
@@ -626,32 +626,16 @@
 _width=2
-, legend=%22y=x%5Ex%22
 )%0A%0Ap.lin
@@ -650,16 +650,44 @@
 *(x**2),
+ legend=%22y=10%5E(x%5E2)%22,%0A      
  line_co
@@ -718,20 +718,16 @@
 dashed%22,
-%0A   
  line_wi
@@ -735,33 +735,98 @@
 th=2
-, 
+)%0A%0Ap.
 legend
-=%22y=10%5E(x%5E2)
+.location = %22top_left%22%0A%0Aoutput_file(%22logplot.html%22, title=%22log axis example
 %22)%0A%0A
-%0A
 show

clean up logplot.py