<jupyter_start><jupyter_text>`ggplot``ggplot` is the base layer or object that you use to definethe components of your chart (x and y axis, shapes, colors, etc.).You can combine it with layers (or geoms) to make complex graphicswith minimal effort. `ggplot` has 2 parameters:- (1) What data is going to be used for your plot _(the data frame being used)_- (2) How that data is going to be displayed _(the aesthetics)_You can add layers to `ggplot` to build up your plot. For the example below we'll start with a `ggplot` that has the `x` aesthetic defined as the `price` column from the `diamonds` dataset. We'll then add a `geom_histogram` to it and then finally add `scale_x_continuous` to customize the x-axis.<jupyter_code>p = ggplot(aes(x='price'), data=diamonds)
p + geom_histogram()
p + geom_histogram() + scale_x_continuous("Price ($)", breaks=[0, 10000, 20000])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09666666666666666, 'fraction_numerical': 0.015555555555555555, 'mean_word_length': 5.435714285714286, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '66844', 'license': 'BSD-2-Clause', 'n_tokens_mistral': 290, 'n_tokens_neox': 265, 'n_words': 126, 'path': 'docs/plotting/ggplot.ipynb', 'repo_name': 'bpopeters/ggpy', 'size': '900'}