Skip to content

Instantly share code, notes, and snippets.

@slinderman
Created November 16, 2017 19:25
Show Gist options
  • Save slinderman/b3507b14c7f5a55335560664fded0ce3 to your computer and use it in GitHub Desktop.
Save slinderman/b3507b14c7f5a55335560664fded0ce3 to your computer and use it in GitHub Desktop.
Bars for Matt
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"\n",
"from hips.plotting.colormaps import gradient_cmap\n",
"from hips.plotting.layout import create_axis_at_location\n",
"import seaborn as sns\n",
"sns.set_style(\"white\")\n",
"sns.set_context(\"paper\")\n",
"color_names = [\"windows blue\",\n",
" \"red\",\n",
" \"amber\",\n",
" \"faded green\",\n",
" \"dusty purple\",\n",
" \"orange\",\n",
" \"clay\",\n",
" \"pink\",\n",
" \"greyish\",\n",
" \"mint\",\n",
" \"light cyan\",\n",
" \"steel blue\",\n",
" \"forest green\",\n",
" \"pastel purple\",\n",
" \"salmon\",\n",
" \"dark brown\"]\n",
"colors = sns.xkcd_palette(color_names)\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# make fake data\n",
"N = 10\n",
"names = [\n",
" \"Kermit the Frog\",\n",
" \"Miss Piggy\",\n",
" \"Fozzie Bear\",\n",
" \"Gonzo\",\n",
" \"Rowlf\",\n",
" \"Scooter\",\n",
" \"Pepe\",\n",
" \"Rizzo\",\n",
" \"Animal\",\n",
" \"Walter\"]\n",
"ys = np.random.gamma(1, 1, size=N)\n",
"yerrs = np.random.gamma(1, 0.1, size=N)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAJwAAACcCAYAAACKuMJNAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADapJREFUeJzt3X1M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/5pYWdAheuDzs/qKZVK6PV6eHp64tENxKP3x4wZAwAIDg7GlStX\nAABhYWFdll29ehXp6ekwGAwoKirqsimdPHkyVCoV5s+fj9LSUshlQ0SF64PHXXrdx8fHdnXFixcv\n2pZfuHABAHD+/Hno9frHLtPr9Vi6dCmysrIQHx+PwMBACIIAURTxxx9/ICgoCHv27MGNGzdw6VLv\n3zFwBlS4p6RSqeDn54eYmJgury6rqqowd+5c5OTkwGAwAADOnDkDg8GAc+fOITIyEgkJCUhLS8Oc\nOXNw9OhRjBgxAoGBgdi2bRtGjx6NnTt3Ii4uDqIocv8ktFToRYMEOl88fPbZZ7ZlOTk5aG5uRlxc\nnAOTOR7NcIQrmuEIVzTDEa6ocIQrKhzhigpHuKLCEa6ocISr/wLkwz+FKcNe4AAAAABJRU5ErkJg\ngg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x119ae7c18>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Make a bar chart with errorbars\n",
"fig = plt.figure(figsize=(2,2))\n",
"ax = fig.add_subplot(111)\n",
"\n",
"# Remove spines and stuff\n",
"ax.spines['top'].set_visible(False)\n",
"ax.spines['right'].set_visible(False)\n",
"ax.get_xaxis().tick_bottom()\n",
"ax.get_yaxis().tick_left()\n",
"\n",
"# Make bar plot, save handles\n",
"width = 0.8\n",
"handles = []\n",
"for n in range(N):\n",
" h = ax.bar(n, ys[n], yerr=yerrs[n],\n",
" width=width, color=colors[n], ecolor='k')[0]\n",
" handles.append(h)\n",
" \n",
"# Plot the zero line\n",
"ax.plot([-0.5, n+0.5], np.zeros(2), '-k')\n",
"\n",
"# Set the labels\n",
"ax.set_xticks([])\n",
"ax.set_xlabel(\"muppets\")\n",
"ax.set_ylabel(\"awesomeness\")\n",
"\n",
"plt.tight_layout(pad=0.1)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_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c597qeu9zrq6uJjMzEwsLC6RSqU4CFARBeJ3U1tZSXFxMr169MDEx0eqrNzkLgiAI\n+iMWBAVBEJogkZwFQRCaIJGcBUEQmiCRnAVBEJqg/wNFn5e4UD8kXgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x119acff98>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Make a legend in a separate figure\n",
"fig = plt.figure(figsize=(5, .6))\n",
"ax = create_axis_at_location(fig, 0.1, 0.1, 4.8, .4)\n",
"ax.legend(handles, names, ncol=5, handlelength=1, loc=\"center\")\n",
"ax.set_xticks([])\n",
"ax.set_yticks([])"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [Root]",
"language": "python",
"name": "Python [Root]"
},
"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.5.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment