#260: Background color and opacity of graphics output
---------------------------+------------------------------------------------
Reporter: was | Owner: was
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-4.2
Component: graphics | Keywords:
Work_issues: | Author: Mitesh Patel
Reviewer: | Merged:
---------------------------+------------------------------------------------
Changes (by newvalueoldvalue):
* cc: kcrisman (added)
* status: needs_work => needs_review
* author: => Mitesh Patel
Comment:
The [attachment:trac_260-plot_bg_alpha.patch new patch] adds
`background_color` and `opacity` keyword options to `plot()`. Examples:
{{{
#!python
sage: plot(x^cos(x^(sin(x))), (0, 30), fill='axis', fillcolor='yellow',
opacity=0.5)
}}}
{{{
#!python
sage: C = 1.0
sage: a, b = var('a, b')
sage: lem = contour_plot(2 * C^2 * (b^2 - a^2) - (a^2 + b^2)^2, (a, -2,
2), (b, -2, 2), plot_points=100, transparent=True, contours=25,
cmap='Spectral')
sage: lem.show(aspect_ratio=1.0, background_color='khaki')
}}}
Can a Sage plotting or matplotlib expert point out how to make the
background uniform when ''both'' `background_color` and `opacity` are
given? Try this:
{{{
#!python
sage: plot(x^cos(x^(sin(x))), (0, 30), fill='axis', fillcolor='yellow',
background_color='red', opacity=0.5)
}}}
Note how the plot's thick "border" has a different apparent transparency
level. Is this an [http://en.wikipedia.org/wiki/Alpha_compositing alpha
compositing] or blending problem?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/260#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---