{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Scatterplot with Categories" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A function to quickly produce a scatter plot colored by categories from a pandas `DataFrame` or NumPy `ndarray` object." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "> from mlxtend.general_plotting import category_scatter" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Overview" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### References\n", "\n", "- -" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 1 - Category Scatter from Pandas DataFrames" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | label | \n", "x | \n", "y | \n", "
|---|---|---|---|
| 0 | \n", "class1 | \n", "10.0 | \n", "8.04 | \n", "
| 1 | \n", "class1 | \n", "10.5 | \n", "7.30 | \n", "
| 2 | \n", "class2 | \n", "8.3 | \n", "5.50 | \n", "
| 3 | \n", "class2 | \n", "8.1 | \n", "5.90 | \n", "
| 4 | \n", "class3 | \n", "3.5 | \n", "3.50 | \n", "
| 5 | \n", "class3 | \n", "3.8 | \n", "5.10 | \n", "