Davide-sd / sympy-plot-backends

An improved plotting module for SymPy
BSD 3-Clause "New" or "Revised" License
44 stars 10 forks source link

Document how to set colors in `plot_geometry` #27

Closed James-G-Hill closed 1 year ago

James-G-Hill commented 1 year ago

I cannot figure out how to set the color of an object when using plot_geometry such as here:

plot_geometry(
    (Segment((0, 0), (1, 0)), 'r')
)

I've tried adding variations on the following with different key names in the dictionary but nothing works for me:

plot_geometry(
    (Segment((0, 0), (1, 0)), 'r', {'color': 'red'})
)

Searching through the matplotlib backend links didn't reveal the magic keyword I need to be using. Maybe it would be good to demonstrate how to do this in one of the documented examples for plot_geometry?

Davide-sd commented 1 year ago

Hello James, that's a bug...

For the moment you can use the rendering_kw keyword argument:

plot_geometry(
    Segment((0, 0), (1, 0)), 'r', rendering_kw={"color": "g"}
)
Davide-sd commented 1 year ago

I just released a new version which fixes this bug. It's already available on PyPi and should become available on Conda in a couple of days.

Thanks James for opening this issue. I'm closing it now.