#4303: Plotting: points(list_of_points, rgbcolor=c) gives strangely colored
results with exactly 3 points.
----------------------------+-----------------------------------------------
Reporter: jbandlow | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-3.1.4
Component: user interface | Resolution:
Keywords: plotting |
----------------------------+-----------------------------------------------
Comment (by mhampton):
I wonder if this is related to the apparent special casing of 3 or fewer
points in GraphicPrimitiveFactory_from_point_list (code below, from
sage/plot/plot.py). That was the best lead I can find with the time I
have, hope it helps.
{{{
class GraphicPrimitiveFactory_from_point_list(GraphicPrimitiveFactory):
def __call__(self, points, coerce=True, **kwds):
try:
return points.plot(**kwds)
except AttributeError:
pass
options = dict(self.options)
for k, v in kwds.iteritems():
options[k] = v
if not isinstance(points, (list,tuple)) or \
(isinstance(points,(list,tuple)) and len(points) <= 3 \
and len(points) > 0 \
and not isinstance(points[0], (list,tuple))):
try:
points = [[float(z) for z in points]]
except TypeError:
pass
try:
if len(points) > 0 and len(points[0]) == 3:
return self._graphic3d()(points, coerce=coerce, **kwds)
except (AttributeError, TypeError):
pass
xdata = []
ydata = []
if coerce:
xdata = [float(z[0]) for z in points]
ydata = [float(z[1]) for z in points]
else:
xdata = [z[0] for z in points]
ydata = [z[1] for z in points]
return self._from_xdata_ydata(xdata, ydata, True, options=options)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4303#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---