Ask Your Question
0

Transparency option in streamline plot

asked 2017-05-29 15:20:26 +0100

mforets gravatar image

In most graphics functions it's possible to set the transparency of the plot with the alpha option. In a streamline plot, e.g. take

sage: var('x, y')
sage: streamline_plot((y, -x**2 * y - x + y), (x, -3, 3), (y, -3, 3), density=1.4, color='black')

it doesn't work:

sage: var('x, y')
sage: streamline_plot((y, -x**2 * y - x + y), (x, -3, 3), (y, -3, 3), density=1.4, color='black', alpha=0.5)
...
WARNING: Ignoring option 'alpha'=0.500000000000000
...

Is there a workaround for this?

edit retag flag offensive close merge delete

Comments

Cool, thanks!! that solves the problem. (I fiddled around with def streamline_plot(f_g, xrange, yrange, **options) but i didn't get it work.)

mforets gravatar imagemforets ( 2017-05-29 18:50:10 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2017-05-29 18:00:03 +0100

ndomes gravatar image

You can use PIL to blend two images with alpha option. See an example here

edit flag offensive delete link more
1

answered 2017-05-30 14:31:49 +0100

kcrisman gravatar image

@ndomes has a good answer, but probably this is a bug too. I've opened Trac 23104 for it.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-05-29 15:20:26 +0100

Seen: 818 times

Last updated: May 30 '17