Commit 40be1394 authored by henryfl's avatar henryfl
Browse files

Updated box plot output

parent 7c377201
No preview for this file type
......@@ -46,7 +46,7 @@ foo@bar:~$ python3 customize.py --election h --vra 0 5000
Each run of the code should output five image files. Although the code is random, if you use the default random seed for our code, you should get the same results. The first is a box plot comparing the sorted Democratic vote percentages of the districts in the original enacted plan chosen to the ensemble.
It should look like this ( it needs to be stretched to view the numbering):
It should look like this:
![Boxplot](readmePics/BoxSTH.png)
......
......@@ -230,13 +230,15 @@ def boxplot(graph, precincts, election_type, my_updaters, partitions, args, name
# Draw initial plan's Democratic vote %s
pl.plot(sorted(partitionForPlot[args.edata].percents("Democratic")), "ro")
length = len(partitionForPlot[args.edata].percents("Democratic"))
# Annotate
ax.set_title("Comparing the 2011 Michigan " + name + " District Plan to an Ensemble")
ax.set_ylabel("Democratic vote % (" + args.edata + ")")
ax.set_xlabel("Sorted districts")
ax.set_ylim(0, 1)
ax.set_yticks([0, 0.25, 0.5, 0.75, 1])
if election_type == "HDIST" or election_type == "SENDIST":
ax.set_xticks([x for x in range(0, length + 1, 5)])
pl.savefig("Comparingthe2011Michigan" + name + "DistrictPlantoanEnsemble.png")
pl.show()
......@@ -364,3 +366,4 @@ def main():
if __name__ == "__main__":
main()
No preview for this file type
readmePics/BoxSTH.png

939 KB | W: | H:

readmePics/BoxSTH.png

729 KB | W: | H:

readmePics/BoxSTH.png
readmePics/BoxSTH.png
readmePics/BoxSTH.png
readmePics/BoxSTH.png
  • 2-up
  • Swipe
  • Onion skin
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment