Skip to content

Matplotlib is currently used in a hybrid way (explicit vs. implicit interfaces) #319

@mkcor

Description

@mkcor

Reference: https://matplotlib.org/stable/users/explain/quick_start.html#the-explicit-and-the-implicit-interfaces

I believe that we should use the "object-oriented (OO) style" throughout the lesson, since we have created figure and axis objects. At the moment, we are mixing up the OO-style with the pyplot-style. For instance, 328d544 adds figure and axis objects, but we still have all the pyplot-style legacy. I would change, e.g.,

fig, ax = plt.subplots()
plt.plot(bin_edges[0:-1], histogram)
plt.title("Grayscale Histogram")
plt.xlabel("grayscale value")
plt.ylabel("pixels")
plt.xlim(0, 1.0)

into

fig, ax = plt.subplots()
ax.plot(bin_edges[0:-1], histogram)
ax.set_title("Grayscale Histogram")
ax.set_xlabel("grayscale value")
ax.set_ylabel("pixels")
ax.set_xlim(0, 1.0);

/cc @datacarpentry/image-processing-curriculum-maintainers

Originally posted by @mkcor in #316 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedLooking for Contributorstype:clarificationSuggest change for make lesson clearertype:enhancementPropose enhancement to the lesson

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions