You can create a [[matplotlib]] plot from the [[command line]] in an [[interactive python shell]]. This is helpful if you need to quickly process some data and don't want to set up an entire environment.
First, import `matplotlib`. Then create the plot. Finally, call `plt.show()`.
```python
import geopandas as gpd
import matplotlib.pyplot as plt
shp = gpd.read_file('my_shapefile.shp')
shp.plot()
plt.show()
```
For the above example, you should first start an interactive python shell in the repository where `my_shapefile.shp` resides.
1. Navigate to the directory where `my_shapefile.shp` resides.
2. Right-click to open the context menu.
3. Select **Get Bash Here**.
4. Start an interactive python session using the command `python`.
You could also create a script file in `my_shapefile.shp`'s directory and run the script from the command line.
```bash
python -m 'my_script.py'
```
The plot will show after the script runs.