Skip to content

Commit 02677a3

Browse files
author
Release Manager
committed
gh-40668: remove some deprecations in plot folder about - File: src/sage/plot/histogram.py ; PR: #25260 ; Closed Date: 2018-10-20 - File: src/sage/plot/plot3d/list_plot3d.py ; PR: #27084 ; Closed Date: 2019-01-26 - File: src/sage/plot/matrix_plot.py ; PR: #27891 ; Closed Date: 2020-02-25 - File: src/sage/plot/graphics.py ; PR: #28675 ; Closed Date: 2019-11-24 ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. URL: #40668 Reported by: Frédéric Chapoton Reviewer(s): David Coudert
2 parents c13346c + 55d65d8 commit 02677a3

File tree

4 files changed

+1
-57
lines changed

4 files changed

+1
-57
lines changed

src/sage/plot/graphics.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3552,28 +3552,3 @@ def inset(self, graphics, pos=None, fontsize=None):
35523552
elif 'fontsize' not in graphics._extra_kwds:
35533553
graphics._extra_kwds['fontsize'] = 6
35543554
return MultiGraphics([(self, pos0), (graphics, pos)])
3555-
3556-
3557-
# Deprecation notice for GraphicsArray import
3558-
def GraphicsArray(*args, **kwargs):
3559-
r"""
3560-
This is deprecated (see :issue:`28675`).
3561-
Use :class:`sage.plot.multigraphics.GraphicsArray` instead.
3562-
3563-
TESTS::
3564-
3565-
sage: from sage.plot.graphics import GraphicsArray
3566-
sage: c = circle((0,0), 1)
3567-
sage: G = GraphicsArray([c, c])
3568-
doctest:...: DeprecationWarning: GraphicsArray must be imported from
3569-
sage.plot.multigraphics and no longer from sage.plot.graphics.
3570-
See https://github.com/sagemath/sage/issues/28675 for details.
3571-
sage: G
3572-
Graphics Array of size 1 x 2
3573-
"""
3574-
from .multigraphics import GraphicsArray as NewGraphicsArray
3575-
from sage.misc.superseded import deprecation
3576-
deprecation(28675, "GraphicsArray must be imported from "
3577-
"sage.plot.multigraphics and no longer from "
3578-
"sage.plot.graphics.")
3579-
return NewGraphicsArray(*args, **kwargs)

src/sage/plot/histogram.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ def __init__(self, datalist, options):
5252
"""
5353
import numpy as np
5454
self.datalist = np.asarray(datalist, dtype=float)
55-
if 'normed' in options:
56-
from sage.misc.superseded import deprecation
57-
deprecation(25260, "the 'normed' option is deprecated. Use 'density' instead.")
5855
if 'linestyle' in options:
5956
from sage.plot.misc import get_matplotlib_linestyle
6057
options['linestyle'] = get_matplotlib_linestyle(
@@ -160,13 +157,12 @@ def _allowed_options(self):
160157
'rwidth': 'The relative width of the bars as a fraction of the bin width',
161158
'cumulative': '(True or False) If True, then a histogram is computed in which each bin gives the counts in that bin plus all bins for smaller values. Negative values give a reversed direction of accumulation.',
162159
'range': 'A list [min, max] which define the range of the histogram. Values outside of this range are treated as outliers and omitted from counts.',
163-
'normed': 'Deprecated. Use density instead.',
164160
'density': '(True or False) If True, the counts are normalized to form a probability density. (n/(len(x)*dbin)',
165161
'weights': 'A sequence of weights the same length as the data list. If supplied, then each value contributes its associated weight to the bin count.',
166162
'stacked': '(True or False) If True, multiple data are stacked on top of each other.',
167163
'label': 'A string label for each data list given.'}
168164

169-
def _repr_(self):
165+
def _repr_(self) -> str:
170166
"""
171167
Return text representation of this histogram graphics primitive.
172168

src/sage/plot/matrix_plot.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -552,20 +552,7 @@ def matrix_plot(mat, xrange=None, yrange=None, **options):
552552
sage: P = matrix_plot(random_matrix(RDF, 5))
553553
sage: P.aspect_ratio()
554554
1
555-
556-
The origin keyword is deprecated::
557-
558-
sage: matrix_plot(identity_matrix(100), origin='lower')
559-
doctest:...: DeprecationWarning: the option 'origin' is replaced by 'flip_y'
560-
See https://github.com/sagemath/sage/issues/27891 for details.
561-
Graphics object consisting of 1 graphics primitive
562555
"""
563-
if 'origin' in options:
564-
from sage.misc.superseded import deprecation
565-
deprecation(27891, "the option 'origin' is replaced by 'flip_y'")
566-
options['flip_y'] = (options['origin'] != 'lower')
567-
del options['origin']
568-
569556
import numpy as np
570557
import scipy.sparse as scipysparse
571558
from sage.plot.graphics import Graphics

src/sage/plot/plot3d/list_plot3d.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from sage.structure.element import Matrix
66
from sage.matrix.constructor import matrix
77
from sage.rings.real_double import RDF
8-
from sage.misc.superseded import deprecation
98

109

1110
def list_plot3d(v, interpolation_type='default', point_list=None, **kwds):
@@ -247,21 +246,8 @@ def list_plot3d(v, interpolation_type='default', point_list=None, **kwds):
247246
Traceback (most recent call last):
248247
...
249248
ValueError: we need at least 3 points to perform the interpolation
250-
251-
TESTS::
252-
253-
sage: P = list_plot3d([(0, 0, 1), (2, 3, 4)], texture='tomato')
254-
doctest:warning...:
255-
DeprecationWarning: please use 'color' instead of 'texture'
256-
See https://github.com/sagemath/sage/issues/27084 for details.
257249
"""
258250
import numpy
259-
if 'texture' in kwds:
260-
deprecation(27084, "please use 'color' instead of 'texture'")
261-
txtr = kwds.pop('texture')
262-
if txtr == "automatic":
263-
txtr = "lightblue"
264-
kwds['color'] = txtr
265251
if isinstance(v, Matrix):
266252
if (interpolation_type == 'default' or
267253
interpolation_type == 'linear' and 'num_points' not in kwds):

0 commit comments

Comments
 (0)