Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 82e8e21

Browse files
author
Leanne Guy
committed
Updat formatting of hovertool on images
1 parent 5acf5fd commit 82e8e21

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

08a_Interactive_Image_Visualization.ipynb

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -372,16 +372,21 @@
372372
"metadata": {},
373373
"outputs": [],
374374
"source": [
375-
"detections = hv.Points(coords).opts(\n",
376-
" fill_color=None, size = 9, color=\"darkorange\")\n",
377-
"\n",
378375
"# Custom hover tool for the source detections\n",
379376
"detHoverTool = HoverTool(\n",
380377
" tooltips=[\n",
381-
" ( 'X', '@x'),\n",
382-
" ( 'Y', '@y'),\n",
383-
" ]\n",
384-
")"
378+
" ( 'X', '@x{0.2f}'),\n",
379+
" ( 'Y', '@y{0.2f}'),\n",
380+
" ],\n",
381+
" formatters={\n",
382+
" 'X' : 'printf',\n",
383+
" 'Y' : 'printf',\n",
384+
" },\n",
385+
" \n",
386+
")\n",
387+
"detections = hv.Points(coords).opts(\n",
388+
" fill_color=None, size = 9, color=\"darkorange\",\n",
389+
" tools=[detHoverTool])"
385390
]
386391
},
387392
{
@@ -398,7 +403,7 @@
398403
"outputs": [],
399404
"source": [
400405
"# Reset the tools on the image and add a hover on the detections.\n",
401-
"rasterize(img.opts(tools=[])) * detections.opts(tools=[detHoverTool])"
406+
"rasterize(img).opts(tools=[]) * detections.opts(tools=[detHoverTool])"
402407
]
403408
},
404409
{

0 commit comments

Comments
 (0)