Skip to content

Commit 285966f

Browse files
#36153 fix legend_color KeyError
1 parent 2f1a76d commit 285966f

File tree

7 files changed

+33
-4
lines changed

7 files changed

+33
-4
lines changed

src/sage/combinat/root_system/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ def cone(self, rays=[], lines=[], color="black", thickness=1, alpha=1, wireframe
13491349
- ``alpha`` -- a number in the interval `[0, 1]` (default: `1`)
13501350
the desired transparency
13511351
1352-
- ``label`` -- an object to be used as for this cone.
1352+
- ``label`` -- an object to be used as the label for this cone.
13531353
The label itself will be constructed by calling
13541354
:func:`~sage.misc.latex.latex` or :func:`repr` on the
13551355
object depending on the graphics backend.

src/sage/plot/arrow.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ def arrow(tailpoint=None, headpoint=None, **kwds):
489489

490490

491491
@rename_keyword(color='rgbcolor')
492-
@options(width=2, rgbcolor=(0,0,1), zorder=2, head=1, linestyle='solid', legend_label=None)
492+
@options(width=2, rgbcolor=(0,0,1), zorder=2, head=1, linestyle='solid',
493+
legend_label=None, legend_color=None)
493494
def arrow2d(tailpoint=None, headpoint=None, path=None, **options):
494495
"""
495496
If ``tailpoint`` and ``headpoint`` are provided, returns an arrow from
@@ -640,6 +641,12 @@ def arrow2d(tailpoint=None, headpoint=None, path=None, **options):
640641
::
641642
642643
sage: arrow2d((-2,2), (7,1)).show(frame=True)
644+
645+
TESTS:
646+
647+
Verify that :trac:`36153` is fixed::
648+
649+
sage: A = arrow2d((-1,-1), (2,3), legend_label="test")
643650
"""
644651
from sage.plot.all import Graphics
645652
g = Graphics()

src/sage/plot/circle.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ def circle(center, radius, **options):
406406
sage: P = circle((1,1), 1)
407407
sage: P.aspect_ratio()
408408
1.0
409+
410+
Verify that :trac:`36153` does not arise::
411+
412+
sage: C = circle((1,1), 1, legend_label="test")
409413
"""
410414
from sage.plot.all import Graphics
411415

src/sage/plot/disk.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def plot3d(self, z=0, **kwds):
247247

248248
@rename_keyword(color='rgbcolor')
249249
@options(alpha=1, fill=True, rgbcolor=(0, 0, 1), thickness=0, legend_label=None,
250-
aspect_ratio=1.0)
250+
legend_color=None, aspect_ratio=1.0)
251251
def disk(point, radius, angle, **options):
252252
r"""
253253
A disk (that is, a sector or wedge of a circle) with center
@@ -346,6 +346,10 @@ def disk(point, radius, angle, **options):
346346
Traceback (most recent call last):
347347
...
348348
ValueError: the center point of a plotted disk should have two or three coordinates
349+
350+
Verify that :trac:`36153` is fixed::
351+
352+
sage: D = disk((0, 0), 5, (0, pi/2), legend_label="test")
349353
"""
350354
from sage.plot.all import Graphics
351355
g = Graphics()

src/sage/plot/ellipse.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ def ellipse(center, r1, r2, angle=0, **options):
345345
E=ellipse((0,0),2,1,legend_label="My ellipse", legend_color='green')
346346
sphinx_plot(E)
347347
348+
TESTS:
349+
350+
Verify that :trac:`36153` does not arise::
351+
352+
sage: E = ellipse((0,0), 2, 1, legend_label="test")
348353
"""
349354
from sage.plot.all import Graphics
350355
g = Graphics()

src/sage/plot/point.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ def point2d(points, **options):
579579
580580
sage: point2d(iter([]))
581581
Graphics object consisting of 0 graphics primitives
582+
583+
Verify that :trac:`36153` does not arise::
584+
585+
sage: P = point((0.5, 0.5), legend_label="test")
582586
"""
583587
from sage.plot.plot import xydata_from_point_list
584588
from sage.plot.all import Graphics

src/sage/plot/polygon.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,15 @@ def polygon2d(points, **options):
524524
sage: polygon2d([[1,2], [5,6], [5,0]]).aspect_ratio()
525525
1.0
526526
527+
TESTS:
528+
529+
Verify that :trac:`36153` does not arise::
530+
531+
sage: P = polygon2d([[1,2], [5,6], [5,0]], legend_label="test")
532+
527533
AUTHORS:
528534
529535
- David Joyner (2006-04-14): the long list of examples above.
530-
531536
"""
532537
from sage.plot.plot import xydata_from_point_list
533538
from sage.plot.all import Graphics

0 commit comments

Comments
 (0)