8000 [Doc]: Improve examples in documentation · Issue #22266 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
[Doc]: Improve examples in documentation #22266
Closed
@Chandan-h-509

Description

@Chandan-h-509

Documentation Link

https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.scatter.html

Problem

housing.plot(kind="scatter", x="longitude", y="latitude", alpha=0.4, s=housing["population"]/100, label="population", figsize=(10,7), c="median_house_value", cmap=plt.get_cmap("jet"), colorbar=True, )
I recently found the above code on Jupyter notebook and I referred matplotlib documentation in order to understand about the parameter s, c and alpha. But, I found it difficult to understand about these parameters, and found it unclear due to lack of explanation in the examples provided. The examples provided just has code and no explanation of the parameters.

Suggested improvement

  1. Along with making the users select the examples manually and read the code, I feel that it would also be good if there is a default example available which contains few basic parameters to give a feel of what a particular function does.
  2. I feel there should be a clear explanation of what the particular parameter does, and not just code(in the examples).
  3. It would be even better if an example is further modified by tweeking/changing the value of a particular parameter, so that the user can get an even better understanding of what the parameter does.
    For Example: in this https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_symbol.html#sphx-glr-gallery-lines-bars-and-markers-scatter-symbol-py page, you can provide different values of alpha like (0.5,0.2,08) in order to show how the output differs.

Matplotlib Version

3.5.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0