Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions chaco/array_plot_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ def set_data(self, name, new_data, generate_name=False):
-------
The name under which the array was set.

See Also
--------
update_data: Use if needing to set multiple ArrayPlotData entries at
once, for example because new arrays' dimensions change and
updating one at a time would break an existing Plot.
"""
if not self.writable:
return None
Expand All @@ -135,12 +140,19 @@ def set_data(self, name, new_data, generate_name=False):


def update_data(self, *args, **kwargs):
""" Sets the specified array as the value for either the specified
name or a generated name.
""" Updates any number of arrays before triggering a `data_changed`
event.

Useful to set multiple ArrayPlotData entries at once, for example
because new arrays' dimensions change and updating one at a time would
break an existing Plot.

Implements AbstractPlotData's update_data() method. This method has
the same signature as the dictionary update() method.
Note: Implements AbstractPlotData's update_data() method. This method
has the same signature as the dictionary update() method.

See Also
--------
set_data: Simpler interface to set only 1 entry at a time.
"""
if not self.writable:
return None
Expand Down