aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-11-29 10:07:28 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-11-29 10:07:28 +0100
commit06773878629f7436ff1d755f3532a7cfa8afe506 (patch)
tree960222655b7f106963ce432b35a9058e6f123f12
parentREADME: update (diff)
downloadsorting-algorithms-06773878629f7436ff1d755f3532a7cfa8afe506.tar.gz
sorting-algorithms-06773878629f7436ff1d755f3532a7cfa8afe506.zip
put plots in img/
-rw-r--r--.gitignore2
-rw-r--r--plot.bat4
-rwxr-xr-xplot.sh6
3 files changed, 8 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index c0da6bc..d8fb1a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
__pycache__/
*.png
-!plots/*.png
+/img/
diff --git a/plot.bat b/plot.bat
index ba89772..3a2f22d 100644
--- a/plot.bat
+++ b/plot.bat
@@ -29,12 +29,14 @@ if "%~4" == "" (
set "max=%~4"
)
+mkdir /p img
+
for %%i in (best average worst) do (
plot.py "%algorithm%" ^
--input "%%i" ^
--min "%min%" --max "%max%" ^
--iterations "%iterations%" ^
- --output "%algorithm%_%iterations%_%%i_%min%_%max%.png" || exit /b !errorlevel!
+ --output "img\%algorithm%_%iterations%_%%i_%min%_%max%.png" || exit /b !errorlevel!
)
exit /b 0
diff --git a/plot.sh b/plot.sh
index 884661c..60bad3a 100755
--- a/plot.sh
+++ b/plot.sh
@@ -32,15 +32,17 @@ main() {
local max="$default_max"
[ "$#" -ge 4 ] && max="$4"
+ mkdir -p -- "$script_dir/img"
+
local input_kind
for input_kind in best average worst; do
- local output_path="$script_dir/${algorithm}_${iterations}_${input_kind}_${min}_${max}.png"
+ local output_name="${algorithm}_${iterations}_${input_kind}_${min}_${max}.png"
python "$script_dir/plot.py" \
"$algorithm" \
--input "$input_kind" \
--min "$min" --max "$max" \
--iterations "$iterations" \
- --output "$output_path"
+ --output "$script_dir/img/$output_name"
done
}