Opened 3 years ago

Last modified 2 years ago

#21984 new enhancement

Deprecate the opacity argument for plot3d and use alpha

Reported by: mathzeta2 Owned by:
Priority: minor Milestone: sage-7.5
Component: graphics Keywords: days79
Cc: yzh, mkoeppe, slelievre Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #25095 Stopgaps:


Most 3d plot functions use the "opacity" keyword argument to set the transparency of the plot. On the other hand, most 2d plot functions use the "alpha" keyword argument.

It seems that the "opacity" keyword argument is also not well-documented. It sometimes appears only in the Examples sections, and not in the Input section. This is the case, at least in the following:

  • plot3d()
  • line()
  • circle()
  • parametric_plot3d()
  • revolution_plot3d()

Harmonizing the 2d plot and 3d plot functions would be a better UI. For example, changing a single letter of obj.plot2d(some_args, alpha=0.5) to obj.plot3d(some_args, alpha=0.5) (or vice versa) should "just work", without ignoring arguments.

Change History (2)

comment:1 Changed 2 years ago by yzh

  • Cc yzh added
  • Dependencies set to #25095

See #25095. In the plot3d functions, the argument "alpha" is equivalent to "opacity" now.

comment:2 Changed 2 years ago by yzh

  • Cc mkoeppe slelievre added
Note: See TracTickets for help on using tickets.