From ac7a5e449e88379dbedc591ecd1f7131f481e1c3 Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Fri, 31 Mar 2023 15:09:05 +0900 Subject: [PATCH 1/7] examples/demo/zoomed_plot/zoom_plot.py --- examples/demo/zoomed_plot/zoom_plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/demo/zoomed_plot/zoom_plot.py b/examples/demo/zoomed_plot/zoom_plot.py index f06d14cc2..ebcd96c00 100644 --- a/examples/demo/zoomed_plot/zoom_plot.py +++ b/examples/demo/zoomed_plot/zoom_plot.py @@ -24,7 +24,7 @@ from chaco.tools.api import RangeSelection # Relative imports -from .zoom_overlay import ZoomOverlay +from zoom_overlay import ZoomOverlay sample_path = os.path.join("examples", "data", "sample.wav") alt_path = os.path.join("..", "data", "sample.wav") From 91a1b3ddefd987f1543292c736a95ed7a0c9aff0 Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Mon, 3 Apr 2023 10:21:43 +0900 Subject: [PATCH 2/7] fix capitol import path --- examples/user_guide/plot_types/create_plot_snapshots.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/user_guide/plot_types/create_plot_snapshots.py b/examples/user_guide/plot_types/create_plot_snapshots.py index 1fc98bbfa..f6109679f 100644 --- a/examples/user_guide/plot_types/create_plot_snapshots.py +++ b/examples/user_guide/plot_types/create_plot_snapshots.py @@ -434,9 +434,9 @@ def get_image_plot(): def get_image_from_file(): - import os.path + from importlib import resources - filename = os.path.join("..", "..", "demo", "basic", "capitol.jpg") + filename = resources.files('chaco.examples.demo.basic').joinpath('capitol.jpg') image_source = ImageData.fromfile(filename) w, h = image_source.get_width(), image_source.get_height() From 5fb8ee40d5920984c7c459bf251cbf1572daa727 Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Mon, 3 Apr 2023 10:30:52 +0900 Subject: [PATCH 3/7] remove changed zoom plot --- examples/demo/zoomed_plot/zoom_plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/demo/zoomed_plot/zoom_plot.py b/examples/demo/zoomed_plot/zoom_plot.py index ebcd96c00..f06d14cc2 100644 --- a/examples/demo/zoomed_plot/zoom_plot.py +++ b/examples/demo/zoomed_plot/zoom_plot.py @@ -24,7 +24,7 @@ from chaco.tools.api import RangeSelection # Relative imports -from zoom_overlay import ZoomOverlay +from .zoom_overlay import ZoomOverlay sample_path = os.path.join("examples", "data", "sample.wav") alt_path = os.path.join("..", "data", "sample.wav") From b650558816cde91fcd7f48aa7426ea09cd6e1d31 Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Mon, 3 Apr 2023 10:34:56 +0900 Subject: [PATCH 4/7] fix formattingf --- examples/user_guide/plot_types/create_plot_snapshots.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/user_guide/plot_types/create_plot_snapshots.py b/examples/user_guide/plot_types/create_plot_snapshots.py index f6109679f..e6bbbe2d7 100644 --- a/examples/user_guide/plot_types/create_plot_snapshots.py +++ b/examples/user_guide/plot_types/create_plot_snapshots.py @@ -436,7 +436,9 @@ def get_image_plot(): def get_image_from_file(): from importlib import resources - filename = resources.files('chaco.examples.demo.basic').joinpath('capitol.jpg') + filename = resources.files( + 'chaco.examples.demo.basic' + ).joinpath('capitol.jpg') image_source = ImageData.fromfile(filename) w, h = image_source.get_width(), image_source.get_height() From 69cf21c645c50bcca680343df7f2b64ac41f222f Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Tue, 4 Apr 2023 11:00:06 +0900 Subject: [PATCH 5/7] fix traits image example --- examples/tutorials/scipy2008/traits_image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tutorials/scipy2008/traits_image.py b/examples/tutorials/scipy2008/traits_image.py index 8a7e46382..3f1f360fd 100644 --- a/examples/tutorials/scipy2008/traits_image.py +++ b/examples/tutorials/scipy2008/traits_image.py @@ -38,8 +38,8 @@ def __init__(self): self.renderer = plot.img_plot( "imagedata", name="plot1", - xbounds=xgrid, - ybounds=ygrid, + xbounds=(0, 6), + ybounds=(0, 8), colormap=viridis, )[0] self.plot = plot From 686b18d7db01c6e46d1fe7c19dc4236e8c2be7b9 Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Tue, 4 Apr 2023 15:23:34 +0900 Subject: [PATCH 6/7] remove unrelated commites --- examples/user_guide/plot_types/create_plot_snapshots.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/user_guide/plot_types/create_plot_snapshots.py b/examples/user_guide/plot_types/create_plot_snapshots.py index e6bbbe2d7..1fc98bbfa 100644 --- a/examples/user_guide/plot_types/create_plot_snapshots.py +++ b/examples/user_guide/plot_types/create_plot_snapshots.py @@ -434,11 +434,9 @@ def get_image_plot(): def get_image_from_file(): - from importlib import resources + import os.path - filename = resources.files( - 'chaco.examples.demo.basic' - ).joinpath('capitol.jpg') + filename = os.path.join("..", "..", "demo", "basic", "capitol.jpg") image_source = ImageData.fromfile(filename) w, h = image_source.get_width(), image_source.get_height() From 49e36e3a7bdadea1eebc968614c1e8abb88a375d Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Tue, 4 Apr 2023 16:47:08 +0900 Subject: [PATCH 7/7] change the order of x and y --- examples/tutorials/scipy2008/traits_image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tutorials/scipy2008/traits_image.py b/examples/tutorials/scipy2008/traits_image.py index 3f1f360fd..051928518 100644 --- a/examples/tutorials/scipy2008/traits_image.py +++ b/examples/tutorials/scipy2008/traits_image.py @@ -38,8 +38,8 @@ def __init__(self): self.renderer = plot.img_plot( "imagedata", name="plot1", - xbounds=(0, 6), - ybounds=(0, 8), + xbounds=(0, 8), + ybounds=(0, 6), colormap=viridis, )[0] self.plot = plot