From 03f0ed249a432f64bbe8ee72137da2fb04dee913 Mon Sep 17 00:00:00 2001 From: seamusholden Date: Wed, 17 Jul 2019 15:08:33 +0100 Subject: [PATCH] Added test case script Added a test script to test the default violinplot and the new plot ordering option before I make further changes --- test_cases/testviolinplot.m | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test_cases/testviolinplot.m diff --git a/test_cases/testviolinplot.m b/test_cases/testviolinplot.m new file mode 100644 index 0000000..6047002 --- /dev/null +++ b/test_cases/testviolinplot.m @@ -0,0 +1,21 @@ + +% TEST CASE 1 +display('Test 1: Violin plot default options'); +load carbig MPG Origin +Origin = cellstr(Origin); +figure +vs = violinplot(MPG, Origin); +ylabel('Fuel Economy in MPG'); +xlim([0.5, 7.5]); + +display('Test 1 passed ok'); + +% TEST CASE 2 +display('Test 2: Test the plot ordering option'); +grouporder={'USA','Sweden','Japan','Italy','Germany','France','England'}; + +figure; +vs2 = violinplot(MPG,Origin,'GroupOrder',grouporder); +display('Test 2 passed ok'); + +%other test cases could be added here