aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2021-01-10 21:56:20 -0500
committerHolden Rohrer <hr@hrhr.dev>2021-01-10 21:56:20 -0500
commit632132cf127a7d6eb121ea216a8001f354579d72 (patch)
treebe8fc822ffc2abb2a8df1a26198dc685bb367ccf
parentd03d94566715cc8febd4f667f56fa14079e51f5e (diff)
fixed axes using figsize
-rw-r--r--py/boxplot.py5
-rw-r--r--py/lineplot.py8
2 files changed, 9 insertions, 4 deletions
diff --git a/py/boxplot.py b/py/boxplot.py
index be1c024..2fd093e 100644
--- a/py/boxplot.py
+++ b/py/boxplot.py
@@ -1,12 +1,15 @@
from data2 import trials
import matplotlib.pyplot as plt
+from matplotlib.transforms import Bbox
+
+plt.figure(figsize=(16,9))
vecs = []
names = []
for trial in trials:
vecs.append(trial.nearest_neighbor())
names.append(str(trial))
-
+
plt.boxplot(vecs, labels=names)
plt.title('Nearest Neighbor for Each Pit in Different Trials')
plt.ylabel('Distance to Nearest Neighbor (cm)')
diff --git a/py/lineplot.py b/py/lineplot.py
index efe6b67..83a99b6 100644
--- a/py/lineplot.py
+++ b/py/lineplot.py
@@ -12,7 +12,7 @@ title = {'nn':'Nearest Neighbor', 'wid':'Pit Width', 'dep':'Pit Depth',
'recl':'Reclusive Population', 'dead':'Cannibalized Individuals'}
names = []
-ct = 0
+plt.figure(figsize=(16,9))
def addvar(key, data):
deps[key][0].append(mean(data))
@@ -29,7 +29,8 @@ for trial in trials:
x = arange(len(names))
width = 0.8;
-plt.yticks(x,labels=names)
+plt.xticks(x,labels=names)
+plt.ylabel('Arbitrary Units')
print(names,avg)
#for var in varlist:
@@ -37,7 +38,8 @@ stdscale = 1/2
for ind in range(len(varlist)):
var = varlist[ind]
div = mean(deps[var][0])
- plt.bar(x-ind*width/len(varlist), [dep/div for dep in deps[var][0]],
+ plt.bar(x-ind*width/len(varlist)+width/2,
+ [dep/div for dep in deps[var][0]],
yerr=[stdscale*dep/div for dep in deps[var][1]], capsize=6,
label=title[var],alpha=0.5, width=width/len(varlist))
#plt.errorbar(names, [dep/div for dep in deps[var][0]],