enthought / enthought/chaco

Docstring description of type in Plot.plot not correct

Open
#518 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
305
Forks
97
PR merge metrics
No merged PRs in 30d

Description

The [docstring description of the `type` parameter](https://github.com/enthought/chaco/blob/192675d6cb579df56458b87988026d895e7a7a84/chaco/plot.py#L282) for `Plot.plot` reads:

> type : comma-delimited string of plot type

However, I do not see where a comma delimited list of plot types is supported in the code, and the following example fails with error:

> ValueError: Unknown plot type: line,scatter

```python
from chaco.api import ArrayPlotData, Plot
from enable.api import ComponentEditor
from traits.api import HasTraits, Instance
from traitsui.api import Item, View

class Demo(HasTraits):

plot = Instance(Plot)
data = Instance(ArrayPlotData)

def _data_default(self):
return ArrayPlotData(
x=[1, 2, 3, 4],
y=[4, 0, 9, 4],
)

def _plot_default(self):
plot = Plot(self.data)
plot.plot(('x', 'y'), type='line,scatter')
return plot

def default_traits_view(self):
return View(
Item('plot', editor=ComponentEditor())
)

if __name__ == '__main__':
Demo().configure_traits()
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.