From a11d674372a19b206e93a2f3077428c65becaa81 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Fri, 7 May 2021 16:17:42 -0500 Subject: [PATCH] replace [] default for data with None --- chaco/plot_factory.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/chaco/plot_factory.py b/chaco/plot_factory.py index 21a736c70..61cca3d13 100644 --- a/chaco/plot_factory.py +++ b/chaco/plot_factory.py @@ -48,7 +48,7 @@ def _create_data_sources(data, index_sort="none"): def create_scatter_plot( - data=[], + data=None, index_bounds=None, value_bounds=None, orientation="h", @@ -69,6 +69,8 @@ def create_scatter_plot( Pre-existing "index" and "value" datasources can be passed in. """ + if data is None: + data = [] index, value = _create_data_sources(data) @@ -109,7 +111,7 @@ def create_scatter_plot( def create_line_plot( - data=[], + data=None, index_bounds=None, value_bounds=None, orientation="h", @@ -130,6 +132,9 @@ def create_line_plot( Pre-existing "index" and "value" datasources can be passed in. """ + if data is None: + data = [] + index, value = _create_data_sources(data, index_sort) if index_bounds is not None: @@ -168,7 +173,7 @@ def create_line_plot( def create_bar_plot( - data=[], + data=None, index_bounds=None, value_bounds=None, orientation="h", @@ -191,6 +196,9 @@ def create_bar_plot( Pre-existing "index" and "value" datasources can be passed in. """ + if data is None: + data = [] + index, value = _create_data_sources(data) if index_bounds is not None: