import
numpy as np
from
bokeh.io
import
curdoc, show
from
bokeh.models
import
ColumnDataSource, Grid, ImageURL, LinearAxis, Plot, Range1d
from
bokeh.plotting
import
figure
url
=
"https:
/
/
media.geeksforgeeks.org
/
wp
-
content
/
\
uploads
/
20210829161730
/
logo.png"
N
=
5
source
=
ColumnDataSource(
dict
(
url
=
[url]
*
N,
x1
=
np.arange(N),
y1
=
np.arange(N),
w1
=
[
35
]
*
N,
h1
=
[
64
]
*
N,
))
xdr
=
Range1d(start
=
-
100
, end
=
300
)
ydr
=
Range1d(start
=
-
100
, end
=
300
)
plot
=
Plot(
title
=
None
, x_range
=
xdr, y_range
=
ydr,
plot_width
=
400
, plot_height
=
400
,
min_border
=
0
, toolbar_location
=
None
)
image
=
ImageURL(url
=
["https:
/
/
media.geeksforgeeks.org
/
\
wp
-
content
/
uploads
/
20210829161730
/
logo.png"],
x
=
50
, y
=
80
, w
=
200
, h
=
250
, anchor
=
"bottom_left"
)
image1
=
ImageURL(url
=
"url"
, x
=
"x1"
, y
=
"y1"
, w
=
"w1"
,
h
=
"h1"
, anchor
=
"center"
)
plot.add_glyph(source, image)
plot.add_glyph(source, image1)
xaxis
=
LinearAxis()
plot.add_layout(xaxis,
'below'
)
yaxis
=
LinearAxis()
plot.add_layout(yaxis,
'left'
)
plot.add_layout(Grid(dimension
=
0
, ticker
=
xaxis.ticker,
grid_line_color
=
'#00ff00'
))
plot.add_layout(Grid(dimension
=
1
, ticker
=
yaxis.ticker,
grid_line_color
=
'#00ff00'
))
curdoc().add_root(plot)
curdoc().theme
=
'caliber'
show(plot)