From 3b330ed7fd9248db8c1ee1f51388d6f5edc4da93 Mon Sep 17 00:00:00 2001 From: test2 Date: Wed, 11 Mar 2020 22:38:56 +0200 Subject: [PATCH] hello --- examples/PieChart.R | 17 +++++++++++++++++ swarmlab/Makefile | 6 +++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 examples/PieChart.R diff --git a/examples/PieChart.R b/examples/PieChart.R new file mode 100644 index 0000000..aa06de0 --- /dev/null +++ b/examples/PieChart.R @@ -0,0 +1,17 @@ +# Draw Pie Chart in R +# Get the library. +library(plotrix) + +# Data for Pie chart +x = c(4, 1, 3, 1, 2) +labels = c('breakfast', 'brunch', 'lunch', 'snacks', 'dinner') +colors = c('#4286f4','#bb3af2','#ed2f52','#efc023','#ea7441') + +# Give the chart file a name. +png(file = "/root/piechart.png") + +# Plot the chart. +pie3D(x, labels=labels, explode=0.1, height=0.05, main='Daily Diet Plan', col=colors) + +# Save the file. +dev.off() diff --git a/swarmlab/Makefile b/swarmlab/Makefile index 2916482..a25c492 100644 --- a/swarmlab/Makefile +++ b/swarmlab/Makefile @@ -1,9 +1,13 @@ -all: hello +all: hello piechart hello: Rscript ../examples/HelloWorld.R +piechart: + + Rscript ../examples/PieChart.R +