Ask Your Question
0

Transparency option in streamline plot

asked 2017-05-29 08:20:26 -0500

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 11:50:10 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
2

answered 2017-05-29 11:00:03 -0500

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 07:31:49 -0500

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 08:20:26 -0500

Seen: 66 times

Last updated: May 30