Verified Commit 3d119e8d authored by Renato Alves's avatar Renato Alves 🌱
Browse files

Add bar-subplot exercise solution

parent e7faa443
......@@ -790,9 +790,31 @@ Which looks great, but something unexpected happened in the stacked subplot.
> ## Rearranging Subplots
>
> Change the function definition above
> Change the previous solution
> so that the subplots are organised in two rows,
> leaving the bottom-left corner empty.
>
> > ## Solution
> >
> > The key here is to ask for a square of subplots and disregard one of them
> > ~~~
> > (...)
> > # We need only to modify the following lines
> > # We use a 2 by 2 figure, make the figure size symmetric
> > fig, axes = plt.subplots(2, 2, figsize=(8, 8))
> > # and since we now get a two dimensional array
> > # we need to expand each dimension
> > # since we want the bottom left to be empty, we can ignore that axis
> > (ax1, ax2), (unused, ax3) = axes
> > # and finally, if we also want to hide the axis and ticks we can call
> > unused.set_axis_off()
> > (...)
> > ~~~
> > {: .language-python}
> >
> > ![subplot barplots 2x2](../fig/barplot-subplot-2x2.png)
> >
> {: .solution}
{: .challenge}
## Others (link to docs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment