Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
notmatthancock opened this issue May 18, 2020 · 0 comments · May be fixed by #906
Open

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

notmatthancock opened this issue May 18, 2020 · 0 comments · May be fixed by #906
Milestone

Comments

@notmatthancock
Copy link
Contributor

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()
@corranwebster corranwebster added this to the Release 5.1.0 milestone Apr 29, 2022
corranwebster added a commit that referenced this issue May 15, 2023
Amongs other things, fixes #518
@corranwebster corranwebster linked a pull request May 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants