Skip to content

Instantly share code, notes, and snippets.

@grantmwilliams
Created March 25, 2022 18:41
Show Gist options
  • Save grantmwilliams/9735589532e77a0c177393cdf181a884 to your computer and use it in GitHub Desktop.
Save grantmwilliams/9735589532e77a0c177393cdf181a884 to your computer and use it in GitHub Desktop.
Example showing common plotting problems with bar charts in pandas data frames
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 30,
"id": "2f873489",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"from matplotlib import cm"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "50df16fa",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>0</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>5</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" 0\n",
"0 1\n",
"1 2\n",
"2 3\n",
"3 4\n",
"4 5"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pd.DataFrame( [ 1, 2, 3, 4, 5 ] )\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "e9e07beb",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:>"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD1CAYAAAB5n7/BAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAL2ElEQVR4nO3dX2ydh13G8echdvBgEUitVa058dwqW6aUP+1wOqFK01ZNNEumcLNJqbQVUZBvUtFJCAjiAnGB5Cv+SOVi0Sj/uwgGVacGskVsAU1A/6Qro102OtaMnpTRNoC6asvWuA8XPo5T7yTn9eL3vL/a348UJT7n5PjRUfvVm9fvsZ1EAIC6fqDrAQCAKyPUAFAcoQaA4gg1ABRHqAGgOEINAMVNtPGk1157bWZnZ9t4agDYkE6dOvVSkulh97US6tnZWT3++ONtPDUAbEi2v365+zj1AQDFEWoAKI5QA0BxrZyjHubVV19Vv9/X+fPnx/Up12xqakq9Xk+Tk5NdTwGAi8YW6n6/r23btml2dla2x/VpG0uic+fOqd/v64Ybbuh6DgBc1CjUts9I+qakRUkXksyt9ROdP3++bKQlybauueYavfjii11PAYDXWcsR9XuTvHQ1n6xqpJdV3wdgc9pUX0w8fvy4du3apZ07d2phYaHrOQDQSNMj6kj6jO1I+liSI6sfYHte0rwkzczMjHzC2cPH1jBztDML+694/+Liog4dOqQTJ06o1+tpz549OnDggHbv3r2uOwCM13q35Ps1qkFXo+kR9W1J3inp/ZIO2X736gckOZJkLsnc9PTQd0F26tFHH9XOnTt14403auvWrTp48KAeeuihrmcBwEiNQp3k+cHvL0h6UNKtbY5qw9mzZ7Vjx46LH/d6PZ09e7bDRQDQzMhQ2/5h29uW/yzpZyQ91faw9TbsZ0PyxUMAbwRNzlFfJ+nBQdQmJD2Q5Hirq1rQ6/X03HPPXfy43+/r+uuv73ARADQzMtR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",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"df.plot(kind=\"bar\", color=cm.tab10.colors[0:5])"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "6c3e7e10",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:>"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD1CAYAAAB5n7/BAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKYElEQVR4nO3cXYylB13H8d/f3aIoBC46abBlWBORF622OCkxTQg0RBdL8EYTmkiJ0UxM2lgSo2K8EC9MuPLlgkQ2WMU3GkUbSdViY62EqLUvVNqyRZEUbSo2jS+lgYDb/r2Ymc6yTDtn7Zw5f3Y/n2SzO+ecPfnlye43zz77nKnuDgBzfcOqBwDw3IQaYDihBhhOqAGGE2qA4YQaYLijy3jTCy+8sI8dO7aMtwY4J91zzz2Pd/faXs8tJdTHjh3L3XffvYy3BjgnVdXnnu05lz4AhhNqgOGEGmA4oQYYTqgBhlvoro+qejjJF5I8leRUd28scxQAu87m9rw3dffjS1sCwJ5c+gAYbtEz6k7yl1XVSd7f3SfOfEFVbSbZTJL19fWDWwjwHN73k7evekKS5LrfuGpp773oGfWV3f26JG9Jcl1VveHMF3T3ie7e6O6NtbU9PwUJwP/DQqHu7ke3f34syc1JrljmKAB27RvqqvqWqnrxzq+TfH+SB5Y9DIAti1yjvijJzVW18/o/6O5bl7oKgGfsG+ru/myS7zmELQDswe15AMMJNcBwQg0wnFADDCfUAMMJNcBwQg0wnFADDCfUAMMJNcBwQg0wnFADDCfUAMMJNcBwQg0wnFADDCfUAMMJNcBwQg0wnFADDCfUAMMJNc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ai7/3zF01aqqn6nu69d9Y7nck78Z2JV/VySa7L18fZHth++JFu3Et7U3e9d1bZJqurHuvu3Vr3jsFTVTyW5LsnJJJcluaG7/3T7uXu7+3UrnHeoquoXs/X9eo4muS3J65PckeTNST7a3b+8unWHp6rOvLW4krwpye1J0t1vO/RRCzhXQv1PSb6zu//3jMdfkOTB7n7lapbNUlX/2t3rq95xWKrq/iTf191PVtWxJB9O8rvd/etV9Ynuvny1Cw/P9rG4LMk3Jvl8kku6+4mqemG2/rXx3avcd1iq6t4kn0rygWz9y7uSfChbJ3Xp7r9Z3bpnd65c+ng6ybcm+dwZj79s+7nzRlV98tmeSnLRYW4Z4MjO5Y7ufriq3pjkw1X1iuz9rRHOZae6+6kkX6yqf+nuJ5Kku79UVefT35GNJDck+YUkP9Pd91XVl6YGese5Eup3JfmrqvrnJP+2/dh6km9Pcv2z/aZz1EVJfiDJf53xeCX528Ofs1Kfr6rLuvu+JNk+s35rkhuTXLrSZYfvK1X1zd39xSTfu/NgVb0k59HJTHc/neRXq+qPtn/+j3wddHD8wEV0961V9R3Z+pasF2crSo8kuWv7LOJ8ckuSF+3E6XRVdcehr1mta5OcOv2B7j6V5Nqqev9qJq3MG7r7y8kzsdpxQZJ3rmbS6nT3I0l+pKquTvLEqvfs55y4Rg1wLnMfNcBwQg0wnFADDCfUAMMJNcBw/wfQCT708Hx9MwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"df.loc[:,0].plot(kind=\"bar\", color=cm.tab10.colors[0:5]) # slice into a pandas series"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "4c83e81c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<AxesSubplot:>"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAD1CAYAAAB5n7/BAAAAOXRF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3Xp7r9Z3bpnd65c+ng6ybcm+dwZj79s+7nzRlV98tmeSnLRYW4Z4MjO5Y7ufriq3pjkw1X1iuz9rRHOZae6+6kkX6yqf+nuJ5Kku79UVefT35GNJDck+YUkP9Pd91XVl6YGese5Eup3JfmrqvrnJP+2/dh6km9Pcv2z/aZz1EVJfiDJf53xeCX528Ofs1Kfr6rLuvu+JNk+s35rkhuTXLrSZYfvK1X1zd39xSTfu/NgVb0k59HJTHc/neRXq+qPtn/+j3wddHD8wEV0961V9R3Z+pasF2crSo8kuWv7LOJ8ckuSF+3E6XRVdcehr1mta5OcOv2B7j6V5Nqqev9qJq3MG7r7y8kzsdpxQZJ3rmbS6nT3I0l+pKquTvLEqvfs55y4Rg1wLnMfNcBwQg0wnFADDCfUAMMJNcBw/wfQCT708Hx9MwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"pd.Series( [ 1, 2, 3, 4, 5 ] ).plot(kind=\"bar\", color=cm.tab10.colors[0:5]) # already a pandas series"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.9.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment