> For the complete documentation index, see [llms.txt](https://shahyaseen71.gitbook.io/technocolabs-data-internship/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shahyaseen71.gitbook.io/technocolabs-data-internship/mini-project/task-4.md).

# Task 4

### Plot running data <a href="#id-4.-plot-running-data" id="id-4.-plot-running-data"></a>

Now we can create our first plot! As we found earlier, most of the activities in my data were running (459 of them to be exact). There are only 29, 18, and two instances for cycling, walking, and unicycling, respectively. So for now, let's focus on plotting the different running metrics.

An excellent first visualization is a figure with four subplots, one for each running metric (each numerical column). Each subplot will have a different y-axis, which is explained in each legend. The x-axis, `Date`, is shared among all subplots.

## Plot running data from 2013 through 2018.

* Subset `df_run` for data from 2013 through 2018. Take into account that observations in dataset stored in chronological order - most recent records first. Assign the result to `runs_subset_2013_2018`.
* In the plotting code, enable subplots by setting the `subplots` parameter to `True`. Don’t use spaces around the `=` sign when used to indicate a keyword argument, as recommended in PEP 8 style guide for Python code.
* Show the plot using `plt.show()`.

## Helpful links:

* Subset time series data [exercise](https://campus.datacamp.com/courses/visualizing-time-series-data-in-python?ex=9) from Visualizing Time Series Data in Python
* `pandas.DataFrame.plot` [documentation](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.plot.html)
* `matplotlib` [cheat sheet](https://datacamp-community-prod.s3.amazonaws.com/28b8210c-60cc-4f13-b0b4-5b4f2ad4790b)
* PEP 8 guide: [Other recommendations](https://pep8.org/#other-recommendations)
