"
],
"text/plain": [
""
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x = random.rand(10)\n",
"y = random.rand(10)\n",
"g = (random.rand(10) * 5).astype('int')\n",
"\n",
"lgn.scatter(x, y, size=10, labels=['group ' + str(i) for i in g], tooltips=True, group=g)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Labeling graph vertices"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"A common use case for tooltips is in labeling graphs. Here we'll make a simple force network and label the vertices based on a group assignment."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"