<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Plotting
Import the LArray library
Step1:  Import the test array population from the demography_eurostat dataset
Step2:  Inline matplotlib (required in notebooks)
Step3:  In a Python script, add the following import on top of the script
Step4:  Create and show a simple plot (last axis define the different curves to draw)
Step5:  Create a Line plot with grid, title, label on y axis and user-defined xticks. 
Save the plot as a png file (using plt.savefig()).
Show the plot
Step6:  Specify line styles and width
Step7:  Move the legend inside the graph (using plt.legend(loc='position'))
Step8:  Put the legend outside the graph (using plt.legend(bbox_to_anchor=(x, y)))
Step9:  Create a Bar plot
Step10:  Create a stacked Bar plot
Step11:  Create a multiplot figure (using plt.subplot(nrows,ncols,index))
<ASSISTANT_TASK:>
Python Code:
from larray import *
Explanation: Plotting
Import the LArray library:
End of explanation
demography_eurostat = load_example_data('demography_eurostat')
population = demography_eurostat.population / 1_000_000
# show the 'population' array
population
Explanation: Import the test array population from the demography_eurostat dataset:
End of explanation
%matplotlib inline
Explanation: Inline matplotlib (required in notebooks):
End of explanation
import matplotlib.pyplot as plt
Explanation: In a Python script, add the following import on top of the script:
End of explanation
population['Belgium'].plot()
# shows the figure
plt.show()
Explanation: Create and show a simple plot (last axis define the different curves to draw):
End of explanation
population['Belgium'].plot(grid=True, xticks=population.time, title='Belgium')
# add a label aling the y axis
plt.ylabel('population (millions)')
# saves figure in a file (see matplotlib.pyplot.savefig documentation for more details)
plt.savefig('Belgium_population.png')
# WARNING: show() reset the current figure after showing it! Do not call it before savefig
plt.show()
Explanation: Create a Line plot with grid, title, label on y axis and user-defined xticks. 
Save the plot as a png file (using plt.savefig()).
Show the plot:
End of explanation
# line styles: '-' for solid line, '--' for dashed line, '-.' for dash-dotted line and ':' for dotted line
population['Male'].plot(style=['-', '--', '-.'], linewidth=2, xticks=population.time, title='Male')
plt.ylabel('population (millions)')
plt.show()
Explanation: Specify line styles and width:
End of explanation
population['Belgium'].plot(xticks=population.time, title='Male')
plt.ylabel('population (millions)')
# available values for loc are: 
# 'best' (default), 'upper right', 'upper left', 'lower left', 'lower right', 'right',
# center left', 'center right', 'lower center', 'upper center', 'center'
plt.legend(loc='lower right')
plt.show()
Explanation: Move the legend inside the graph (using plt.legend(loc='position')):
End of explanation
population['Belgium'].plot(xticks=population.time, title='Male')
plt.ylabel('population (millions)')
plt.legend(bbox_to_anchor=(1.25, 0.6))
plt.show()
Explanation: Put the legend outside the graph (using plt.legend(bbox_to_anchor=(x, y))):
End of explanation
population['Belgium'].plot.bar(title='Belgium')
plt.ylabel('population (millions)')
plt.legend(bbox_to_anchor=(1.25, 0.6))
plt.show()
Explanation: Create a Bar plot:
End of explanation
population['Belgium'].plot.bar(title='Belgium', stacked=True)
plt.ylabel('population (millions)')
plt.legend(bbox_to_anchor=(1.25, 0.6))
plt.show()
Explanation: Create a stacked Bar plot:
End of explanation
figure, axes = plt.subplots(nrows=len(population.country), ncols=1, sharex=True, figsize=(5, 15))
for row, c in enumerate(population.country):  
    population[c].plot(ax=axes[row], title=str(c))
    plt.ylabel('population (millions)')
    
plt.xticks(population.time)
plt.show()
Explanation: Create a multiplot figure (using plt.subplot(nrows,ncols,index)):
End of explanation
<END_TASK>