Skip to content

lib.plot: Use pens/brushes to customize PolyXXX classes #512

Open
@dougthor42

Description

@dougthor42

(This issue was created because PR #117 could not be finished in its entirety)

All of the PolyXXX classes (PolyBars, PolyHistogram, etc.) in lib.plot currently set individual items like edgecolour, fillcolour, and fillstyle.

Instead, it would make for a much cleaner API to simply set Pens for lines and Brushes for fills.

Example:

# before:
hist_variable_binsize = wxplot.PolyHistogram(
    [2, 3, 4, 6, 3],
    [18, 19, 22, 25, 26, 27],
    fillcolour=wx.BLUE,
    edgewidth=2,
    edgecolour=wx.CYAN,
)

#after:
hist_variable_binsize = wxplot.PolyHistogram(
    [2, 3, 4, 6, 3],
    [18, 19, 22, 25, 26, 27],
    fill=Brush(wx.BLUE, style=BRUSHSTYLE_SOLID),
    outline=Pen(wx.CYAN, width=2, style=PENSTYLE_SOLID),    # or "edge=..."
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions