<jupyter_start><jupyter_text>Data used for this tutorial:                            Air quality data            For this tutorial, air quality data about $ NO_2 $ is used, madeavailable by [openaq](https://openaq.org) and using the[py-openaq](http://dhhagan.github.io/py-openaq/index.html) package.The `air_quality_no2.csv` data set provides $ NO_2 $ values forthe measurement stations *FR04014*, *BETR801* and *London Westminster*in respectively Paris, Antwerp and London.                To raw data<jupyter_code>air_quality = pd.read_csv("../data/air_quality_no2.csv", index_col=0, parse_dates=True)
air_quality.head()<jupyter_output><empty_output><jupyter_text>>**Note**>>The usage of the `index_col` and `parse_dates` parameters of the `read_csv` function to define the first (0th) column asindex of the resulting `DataFrame` and convert the dates in the column to `Timestamp` objects, respectively.  How to create plots in pandas?    I want a quick visual check of the data.<jupyter_code>air_quality.plot()<jupyter_output><empty_output><jupyter_text>With a `DataFrame`, pandas creates by default one line plot for each ofthe columns with numeric data.    I want to plot only the columns of the data table with the data from Paris.<jupyter_code>air_quality["station_paris"].plot()<jupyter_output><empty_output><jupyter_text>To plot a specific column, use the selection method of thesubset data tutorial in combination with the `plot()`method. Hence, the `plot()` method works on both `Series` and`DataFrame`.    I want to visually compare the $ N0_2 $ values measured in London versus Paris.<jupyter_code>air_quality.plot.scatter(x="station_london", y="station_paris", alpha=0.5)<jupyter_output><empty_output><jupyter_text>Apart from the default `line` plot when using the `plot` function, anumber of alternatives are available to plot data. Let’s use somestandard Python to get an overview of the available plot methods:<jupyter_code>[
    method_name
    for method_name in dir(air_quality.plot)
    if not method_name.startswith("_")
]<jupyter_output><empty_output><jupyter_text>>**Note**>>In many development environments as well as IPython andJupyter Notebook, use the TAB button to get an overview of the availablemethods, for example `air_quality.plot.` + TAB.One of the options is `DataFrame.plot.box()`, which refers to a[boxplot](https://en.wikipedia.org/wiki/Box_plot). The `box`method is applicable on the air quality example data:<jupyter_code>air_quality.plot.box()<jupyter_output><empty_output><jupyter_text>To user guideFor an introduction to plots other than the default line plot, see the user guide section about supported plot styles.    I want each of the columns in a separate subplot.<jupyter_code>axs = air_quality.plot.area(figsize=(12, 4), subplots=True)<jupyter_output><empty_output><jupyter_text>Separate subplots for each of the data columns are supported by the `subplots` argumentof the `plot` functions. The builtin options available in each of the pandas plotfunctions are worth reviewing.    To user guideSome more formatting options are explained in the user guide section on plot formatting.    I want to further customize, extend or save the resulting plot.<jupyter_code>fig, axs = plt.subplots(figsize=(12, 4))
air_quality.plot.area(ax=axs)
axs.set_ylabel("NO$_2$ concentration")<jupyter_output><empty_output><jupyter_text>Each of the plot objects created by pandas is a[matplotlib](https://matplotlib.org/) object. As Matplotlib providesplenty of options to customize plots, making the link between pandas andMatplotlib explicit enables all the power of matplotlib to the plot.This strategy is applied in the previous example:<jupyter_code>fig, axs = plt.subplots(figsize=(12, 4))        # Create an empty matplotlib Figure and Axes
air_quality.plot.area(ax=axs)                   # Use pandas to put the area plot on the prepared Figure/Axes
axs.set_ylabel("NO$_2$ concentration")          # Do any matplotlib customization you like
fig.savefig("no2_concentrations.png")           # Save the Figure/Axes using the existing matplotlib method.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08624878522837706, 'fraction_numerical': 0.007288629737609329, 'mean_word_length': 5.314417177914111, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 43, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '576491', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1193, 'n_words': 431, 'path': '02_intro_tutorials/04_plotting.ipynb', 'repo_name': 'olippuner/Pandas_Docu_as_Notebooks', 'size': '4116'}