Ticket #9211: trac_9211-fix_doctests.patch

File trac_9211-fix_doctests.patch, 3.2 KB (added by ppurka, 10 years ago)

Fix doctests for 3d plots (re-uploaded)

  • sage/plot/circle.py

    # HG changeset patch
    # User P Purkayastha <ppurka@gmail.com>
    # Date 1318410005 -28800
    # Node ID 55f551edf435eb61949c1f19aba82a23cc60080b
    # Parent  078b8681c2772fcbf71062216d449b26172befa8
    # trac #9211: Fix doctests for 3d graphics
    
    diff --git a/sage/plot/circle.py b/sage/plot/circle.py
    a b  
    195195        """
    196196        options = dict(self.options())
    197197        fill = options['fill']
    198         del options['fill']
    199         del options['linestyle']
    200         del options['edgecolor']
    201         del options['facecolor']
    202         del options['zorder']
     198        for s in ['clip', 'edgecolor', 'facecolor', 'fill', 'linestyle',
     199                'zorder']:
     200            if s in options:
     201                del options[s]
     202
    203203        n = 50
    204204        dt = float(2*pi/n)
    205205        x, y, r = self.x, self.y, self.r
  • sage/plot/scatter_plot.py

    diff --git a/sage/plot/scatter_plot.py b/sage/plot/scatter_plot.py
    a b  
    8080            sage: from sage.plot.scatter_plot import ScatterPlot
    8181            sage: list(sorted(ScatterPlot([-1,2], [17,4], {})._allowed_options().iteritems()))
    8282            [('alpha', 'How transparent the marker border is.'),
    83              ('edgecolor', 'The color of the marker border.'),
    84              ('facecolor', 'The color of the marker face.'),
    85              ('hue', 'The color given as a hue.'),
    86              ('marker', 'What shape to plot the points.'),
    87              ('markersize', 'the size of the markers.'),
    88              ('rgbcolor', 'The color as an RGB tuple.'),
    89              ('zorder', 'The layer level in which to draw.'),
    90              ('clip', 'Whether or not to clip.')]
     83            ('clip', 'Whether or not to clip.'),
     84            ('edgecolor', 'The color of the marker border.'),
     85            ('facecolor', 'The color of the marker face.'),
     86            ('hue', 'The color given as a hue.'),
     87            ('marker', 'What shape to plot the points.'),
     88            ('markersize', 'the size of the markers.'),
     89            ('rgbcolor', 'The color as an RGB tuple.'),
     90            ('zorder', 'The layer level in which to draw.')]
    9191        """
    9292        return {'markersize': 'the size of the markers.',
    9393                'marker': 'What shape to plot the points.',
  • sage/plot/text.py

    diff --git a/sage/plot/text.py b/sage/plot/text.py
    a b  
    122122            options = dict(self.options())
    123123        options_3d = {}
    124124        # TODO: figure out how to implement rather than ignore
    125         if 'fontsize' in options:
    126             del options['fontsize']
    127         if 'vertical_alignment' in options:
    128             del options['vertical_alignment']
    129         if 'horizontal_alignment' in options:
    130             del options['horizontal_alignment']
    131         if 'axis_coords' in options:
    132             del options['axis_coords']
    133         if 'rotation' in options:
    134             del options['rotation']
     125        for s in ['axis_coords', 'clip', 'fontsize', 'horizontal_alignment',
     126                'rotation', 'vertical_alignment' ]:
     127            if s in options:
     128                del options[s]
    135129        options_3d.update(GraphicPrimitive._plot3d_options(self, options))
    136130        return options_3d
    137131