Skip to content

Colors and linewidhs #275

Open
Open
@orynaivashtenko

Description

@orynaivashtenko

I need a quick way to modify the alpha of the filled contours and linewidth of the contours. However, in the current version, the only arguments that are passed to the contourf are colors and antialiased:

if plot_contours and fill_contours:
    if contourf_kwargs is None:
        contourf_kwargs = dict()
    contourf_kwargs["colors"] = contourf_kwargs.get("colors", contour_cmap)
    contourf_kwargs["antialiased"] = contourf_kwargs.get(
        "antialiased", False
    )
    ax.contourf(
        X2,
        Y2,
        H2.T,
        np.concatenate([[0], V, [H.max() * (1 + 1e-4)]]),
        **contourf_kwargs,
      )

Same goes for contour, the code only can use colors and no other argments:

if plot_contours:
        if contour_kwargs is None:
            contour_kwargs = dict()
        contour_kwargs["colors"] = contour_kwargs.get("colors", color)
        ax.contour(X2, Y2, H2.T, V, **contour_kwargs)

In the documentation, it is stated:

"""
contourf_kwargs : dict
        Any additional keyword arguments to pass to the `contourf` method.
"""

so I thought all the parameters of contour and contourf can be controlled. However, in the current version, only a limited set of arguments is passed.

The desired behavior is that I can specify color and alpha, and the contourf levels of the corresponding color and transparency will be generated for me automatically. Also, I want to be able to pass linewidth argument in the contour_kwargs. In general, I think a good idea would be just to pass all the arguments of the contourf_kwargs and contour_kwargs and not just that couple of selected ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions