<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 2D plots
Demonstration of the 2D plot capabilities
The plot2d plot method make plots of 2-dimensional scalar data
using matplotlibs pcolormesh or the contourf functions.
Note that this method is extended by the mapplot plot method of the psy-maps plugin for visualization on the projected globe.
Step1:  First we create some sample data in the form of a 2D parabola
Step2:  For a simple 2D plot of a scalar field, we can use the
plot2d plot method
Step3:  The plot formatoption controls, how the plot is made. The default is a 
pcolormesh 
plot, but we can also make a 
filled contour 
plot. The levels of the contour plot are determined through the levels formatoption.
Step4:  The plot2d method has several formatoptions controlling the color coding of your plot
Step5:  The most important ones are
cbar
<ASSISTANT_TASK:>
Python Code:
import psyplot.project as psy
import xarray as xr
%matplotlib inline
%config InlineBackend.close_figures = False
import numpy as np
Explanation: 2D plots
Demonstration of the 2D plot capabilities
The plot2d plot method make plots of 2-dimensional scalar data
using matplotlibs pcolormesh or the contourf functions.
Note that this method is extended by the mapplot plot method of the psy-maps plugin for visualization on the projected globe.
End of explanation
x = np.linspace(-1, 1.)
y = np.linspace(-1, 1.)
x2d, y2d = np.meshgrid(x, y)
z = - x2d**2 - y2d**2
ds = xr.Dataset(
    {'z': xr.Variable(('x', 'y'), z)},
    {'x': xr.Variable(('x', ), x), 'y': xr.Variable(('y', ), y)})
Explanation: First we create some sample data in the form of a 2D parabola
End of explanation
p = psy.plot.plot2d(ds, cmap='Reds', name='z')
Explanation: For a simple 2D plot of a scalar field, we can use the
plot2d plot method:
End of explanation
p.update(plot='contourf', levels=5)
p.show()
Explanation: The plot formatoption controls, how the plot is made. The default is a 
pcolormesh 
plot, but we can also make a 
filled contour 
plot. The levels of the contour plot are determined through the levels formatoption.
End of explanation
p.keys('colors')
Explanation: The plot2d method has several formatoptions controlling the color coding of your plot:
End of explanation
psy.close('all')
Explanation: The most important ones are
cbar: To specify the location of the colorbar
bounds: To specify the boundaries for the color coding, i.e.
  the categories which data range belongs to which color
cmap: To specify the colormap
End of explanation
<END_TASK>