{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Labeling your datapoints\n\nThis is an example of how to use the `label(s)` kwarg, which must be a list the\nlength of the number of datapoints (rows) you have in the matrix. Here, we\nare simply labeling the first datapoint for each matrix in the list.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Code source: Andrew Heusser\n# License: MIT\n\n# import\nimport hypertools as hyp\nimport numpy as np\n\n# load example data\ngeo = hyp.load('weights_sample')\ndata = geo.get_data()\n\n# simulate labels\nlabels=[]\nfor idx,i in enumerate(data):\n tmp=[]\n for iidx,ii in enumerate(i):\n if iidx==0:\n tmp.append('Subject ' + str(idx))\n else:\n tmp.append(None)\n labels.append(tmp)\n\n# plot\ngeo.plot(fmt='.', labels=labels)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.4" } }, "nbformat": 4, "nbformat_minor": 0 }