Skip to content

Docstring description of type in Plot.plot not correct #518

Description

@notmatthancock

The docstring description of the type parameter 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

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions