import org.apache.commons.math3.distribution.TDistribution; void setup(){ Chart fig; PFont times = loadFont("TimesNewRomanPSMT-16.vlw"); textFont(times); size(400,300); textSize(16); // System.out.println("Figure 2"); fig = new Chart(0,0,400,275); background(255); Gradient gradient = new Gradient(50.0,#b70101,10.0,100,"Gradient Plot"); Violin violin = new Violin(50.0,#b70101,10.0,100,"Violin Plot"); Box box = new Box(50.0,#b70101,10.0,100,"Box Plot"); fig.setAxis("",0.0,100.0,25.0,5.0); fig.setGap(15); fig.addObject(gradient); fig.addObject(violin); fig.addObject(box); BarGroup errors = new BarGroup(#660000); errors.addDot(50.0,gradient.getStdDev()/sqrt(100),100,"S.E."); errors.addDot(50.0,10.0,100,"95%"); errors.addDot(50.0,(65.81797-34.18203)/2.0,100,"99%"); fig.addBarGroup(errors); fig.draw(); save("/InfoVisFigures/Example Encodings.png"); background(255); size(800,450); // System.out.println("Unused"); BarGroup bars = new BarGroup(#66c2a5,"Bar Chart"); BarGroup gradients = new BarGroup(#fc8d62,"Gradient Plot"); BarGroup violins = new BarGroup(#8da0cb,"Violin Plot"); BarGroup boxs = new BarGroup(#e78ac3,"Box Plot"); bars.addGradient(3.9857143,(4.2856992-3.6857293)/2.0,144,"-15"); bars.addGradient(4.2463768,(4.5026822-3.9900715)/2.0,144,"-10"); bars.addGradient(4.8043478,(5.0334223-4.5752734)/2.0,144,"-5"); bars.addGradient(3.8571429,(4.0659989-3.6482868)/2.0,144,"+5"); bars.addGradient(3.173913,(3.4286817-2.9191443)/2.0,144,"+10"); bars.addGradient(2.5144928,(2.7687108-2.2602747)/2.0,144,"+15"); gradients.addGradient(3.4275362, (3.7762003-3.0788721)/2.0, 144, "-15"); gradients.addGradient(3.7971014, (4.0862783-3.5079246)/2.0, 144, "-10"); gradients.addGradient(4.4927536, (4.7732807-4.2122266)/2.0, 144, "-5"); gradients.addGradient(4.4565217, (4.7324947-4.1805488)/2.0, 144, "+5"); gradients.addGradient(3.3115942, (3.5858238-3.0373646)/2.0, 144, "+10"); gradients.addGradient(3.0652174, (3.3888513-2.7415835)/2.0, 144, "+15"); violins.addGradient(3.5, (3.8195074-3.1804926)/2.0, 144, "-15"); violins.addGradient(4, (4.290909-3.709091)/2.0, 144, "-10"); violins.addGradient(4.4236111, (4.6824773-4.1647449)/2.0, 144, "-5"); violins.addGradient(4.3819444, (4.6260343-4.1378545)/2.0, 144, "+5"); violins.addGradient(3.5833333, (3.8619143-3.3047524)/2.0, 144, "+10"); violins.addGradient(3.2013889, (3.5146469-2.8881309)/2.0, 144, "+10"); boxs.addGradient(3.125, (3.4145197-2.8354803)/2.0, 144, "-15"); boxs.addGradient(3.6180556, (3.8727963-3.3633148)/2.0, 144, "-10"); boxs.addGradient(4.4027778, (4.6486668-4.1568887)/2.0, 144, "-5"); boxs.addGradient(4.2847222, (4.5254199-4.0440245)/2.0, 144, "+5"); boxs.addGradient(3.6458333, (3.8587609-3.4329057)/2.0, 144, "+10"); boxs.addGradient(3.2291667, (3.5037816-2.9545517)/2.0, 144, "+10"); fig = new Chart(50,10,750,375); fig.setAxis("Perceived Likelihood of Outcome",0.0,7.0,1.0,0.5); fig.setGap(15); fig.addBarGroup(bars); fig.addBarGroup(gradients); fig.addBarGroup(violins); fig.addBarGroup(boxs); fig.draw(); text("Distance from Sample Mean", 400 - (textWidth("Distance from Sample Mean")/2.0),435); save("/InfoVisFigures/Exp1Distributions.png"); background(255); size(1000,425); // System.out.println("Figure 4b"); fig = new Chart(50,10,950,375); fig.setAxis("Average pdf of Potential outcome",0.0,0.15,0.05,0.01); fig.setGap(5); fig.addGradient(0.0130287,#b70101,(0.0175132-0.0085442)/2.0,75,"1"); fig.addGradient(0.0391623,#b70101,(0.0448546-0.0334699)/2.0,530,"2"); fig.addGradient(0.0802818,#b70101,(0.0876782-0.0728855)/2.0,632,"3"); fig.addGradient(0.0996301,#b70101,(0.107628-0.0916322)/2.0,649,"4"); fig.addGradient(0.101522,#b70101,(0.1105564-0.0924875)/2.0,538,"5"); fig.addGradient(0.1202076,#b70101,(0.1309773-0.1094379)/2.0,449,"6"); fig.addGradient(0.1258966,#b70101,(0.1429278-0.1088654)/2.0,207,"7"); fig.draw(); text("Perceived Likelihood of Outcome (1=Highly Unlikely, 7=Highly Likely)", 500 - (textWidth("Perceived Likelihood of Outcome (1=Highly Unlikely, 7=Highly Likely)")/2.0),415); save("/InfoVisFigures/Exp1pdf.png"); background(255); size(1000,425); // System.out.println("Figure 4a"); fig = new Chart(50,10,950,375); fig.setAxis("Average cdf of Prediction",0.5,1.0,0.1,0.05); fig.setGap(5); fig.addGradient(0.7040266,#b70101,(0.7795868-0.6284664)/2.0,75,"1"); fig.addGradient(0.7742577,#b70101,(0.8174435-0.7310718)/2.0,203,"2"); fig.addGradient(0.7383092,#b70101,(0.778331-0.6982875)/2.0,304,"3"); fig.addGradient(0.7698274,#b70101,(0.7993945-0.7402603)/2.0,515,"4"); fig.addGradient(0.8317058,#b70101,(0.852039-0.8113725)/2.0,897,"5"); fig.addGradient(0.8698803,#b70101,(0.8890022-0.8507584)/2.0,860,"6"); fig.addGradient(0.9370928,#b70101,(0.9546763-0.9195094)/2.0,530,"7"); fig.draw(); text("Participant Confidence (1=Least Confident, 7=Most Confident)", 500 - (textWidth("Participant Confidence (1=Least Confident, 7=Most Confident)")/2.0),415); save("/InfoVisFigures/Exp1cdf.png"); background(255); size(800,450); // System.out.println("Figure 5"); fig = new Chart(50,10,750,375); fig.setAxis("Perceived Likelihood of Outcome",0.0,7.0,1.0,0.5); fig.setGap(15); bars = new BarGroup(#66c2a5,"Bar Chart"); gradients = new BarGroup(#fc8d62,"Gradient Plot"); violins = new BarGroup(#8da0cb,"Violin Plot"); boxs = new BarGroup(#e78ac3,"Box Plot"); bars.addGradient(4.3405797,(4.4958632-4.1852962)/2.0,432,"Below"); bars.addGradient(3.1835749,(3.3314844-3.0356654)/2.0,432,"Above"); gradients.addGradient(3.9057971,(4.0870266-3.7245676)/2.0,432,"Below"); gradients.addGradient(3.6111111,(3.7883731-3.4338491)/2.0,432,"Above"); violins.addGradient(3.974537,(4.1448918-3.8041823)/2.0,432,"Below"); violins.addGradient(3.7222222,(3.8892529-3.5551916)/2.0,432,"Above"); boxs.addGradient(3.7152778,(3.8745063-3.5560493)/2.0,432,"Below"); boxs.addGradient(3.7199074,(3.8656041-3.5742107)/2.0,432,"Above"); fig.addBarGroup(bars); fig.addBarGroup(gradients); fig.addBarGroup(violins); fig.addBarGroup(boxs); fig.draw(); text("Location of Outcome Relative to Mean", 400 - (textWidth("Location of Outcome Relative to Mean")/2.0),435); save("/InfoVisFigures/Exp1WithinTheBar.png"); background(255); size(400,415); // System.out.println("Unused"); fig = new Chart(50,20,350,375); fig.setAxis("Prediction Alignment (%)",0.0,1.0,0.1,0.05); fig.setGap(15); fig.addGradient(0.8321256,#66c2a5,(0.8576361-0.8066152)/2.0,828,"Bar Chart"); fig.addGradient(0.8738426,#e78ac3,(0.8960258-0.8516593)/2.0,828,"Box Plot"); fig.addGradient(0.8852657,#fc8d62,(0.9070185-0.8635129)/2.0,828,"Gradient Plot"); fig.addGradient(0.8923611,#8da0cb,(0.9130676-0.8716546)/2.0,828,"Violin Plot"); fig.draw(); save("/InfoVisFigures/Exp1Corrections.png"); background(255); size(400,420); // System.out.println("Figure 7b"); fig = new Chart(50,10,350,375); fig.setAxis("Prediction Alignment (%)",0.0,1.0,0.1,0.05); fig.setGap(15); fig.addGradient(0.8321256,#66c2a5,(0.8576361-0.8066152)/2.0,828,"Visual Margins\n and Outcome"); fig.addGradient(0.9155093,#a6d854,(0.9340911-0.8969274)/2.0,864,"Visual Margins,\n Textual Outcome"); fig.addGradient(0.6215278,#a6d854,(0.6539318-0.5891237)/2.0,864,"Textual Margins,\n Textual Outcome"); fig.draw(); save("/InfoVisFigures/Exp2Corrections.png"); background(255); size(400,450); // System.out.println("Figure 7a"); fig = new Chart(50,10,350,375); fig.setAxis("Perceived Likelihood of Outcome",0.0,7.0,1.0,0.5); fig.setGap(15); BarGroup visual = new BarGroup(#66c2a5,"Visual Margins\n and Outcome"); BarGroup semivisual = new BarGroup(#a6d854,"Visual Margins,\n Textual Outcome"); BarGroup textual = new BarGroup(#a6d854,"Textual Margins,\n Textual Outcome"); visual.addGradient(4.3405797,(4.4958632-4.1852962)/2.0,432,"Below"); visual.addGradient(3.1835749,(3.3314844-3.0356654)/2.0,432,"Above"); semivisual.addGradient(3.8842593,(4.0579605-3.710558)/2.0,432,"Below"); semivisual.addGradient(3.1481481,(3.3130443-2.983252)/2.0,432,"Above"); textual.addGradient(4.0509259,(4.2160962-3.8857557)/2.0,432,"Below"); textual.addGradient(3.9421296,(4.1127785-3.7714808)/2.0,432,"Above"); fig.addBarGroup(visual); fig.addBarGroup(semivisual); fig.addBarGroup(textual); fig.draw(); save("/InfoVisFigures/Exp2Within.png"); background(255); size(800,435); // System.out.println("Figure 9"); fig = new Chart(50,10,750,375); fig.setAxis("Average Effect Size (Margins of Error of Difference)",0.0,0.5,0.1,0.05); fig.setGap(15); fig.addViolin(0.0964184,#b70101,(0.1055601-0.0872766)/2.0,631,"0"); fig.addViolin(0.1399601,#b70101,(0.1475989-0.1323213)/2.0,1169,"1"); fig.addViolin(0.2532876,#b70101,(0.2670465-0.2395286)/2.0,801,"2"); fig.addViolin(0.3790565,#b70101,(0.3987239-0.3593892)/2.0,855,"3"); fig.draw(); text("Predicted One-Sidedness of Outcome \n(0=Roughly Even, 3=Very One-Sided)", 400 - (textWidth("Predicted One-Sidedness of Outcome")/2.0),415); save("/InfoVisFigures/Exp3effect.png"); background(255); size(500,625); // System.out.println("Figure 8a"); fig = new Chart(50,10,450,575); fig.setAxis("Average p-value of presented graph (two sample t-test)",0.0,0.35,0.05,0.01); fig.setGap(5); fig.addViolin(new Violin(0.1226071,#66c2a5,(0.1649115-0.0803028)/2.0,19,"1")); fig.addViolin(new Violin(0.1187214,#66c2a5,(0.1498959-0.087547)/2.0,39,"2")); fig.addViolin(new Violin(0.0992993,#66c2a5,(0.1208698-0.0777287)/2.0,63,"3")); fig.addViolin(new Violin(0.064671,#66c2a5,(0.07699-0.052352)/2.0,161,"4")); fig.addViolin(new Violin(0.0570933,#66c2a5,(0.0694556-0.044731)/2.0,154,"5")); fig.addViolin(new Violin(0.0296468,#66c2a5,(0.0390021-0.0202915)/2.0,192,"6")); fig.addViolin(new Violin(0.0258875,#66c2a5,(0.0333778-0.0183971)/2.0,236,"7")); fig.draw(); text("Participant Confidence (1=Least Confident, 7=Most Confident)", 250 - (textWidth("Participant Confidence (1=Least Confident, 7=Most Confident)")/2.0),615); save("/InfoVisFigures/Exp3pBar.png"); background(255); size(500,625); // System.out.println("Figure 8b"); fig = new Chart(50,10,450,575); fig.setAxis("Average p-value of presented graph (two sample t-test)",0.0,0.35,0.05,0.01); fig.setGap(5); fig.addViolin(new Violin(0.2072852,#e78ac3,(0.2501367-0.1644336)/2.0,11,"1")); fig.addViolin(new Violin(0.1158806,#e78ac3,(0.1444204-0.0873409)/2.0,43,"2")); fig.addViolin(new Violin(0.0694431,#e78ac3,(0.0878222-0.051064)/2.0,85,"3")); fig.addViolin(new Violin(0.0749605,#e78ac3,(0.0891723-0.0607487)/2.0,126,"4")); fig.addViolin(new Violin(0.0447,#e78ac3,(0.0542529-0.0351471)/2.0,228,"5")); fig.addViolin(new Violin(0.0231925,#e78ac3,(0.0323795-0.0140054)/2.0,147,"6")); fig.addViolin(new Violin(0.0129568,#e78ac3,(0.0187954-0.0071183)/2.0,224,"7")); fig.draw(); text("Participant Confidence (1=Least Confident, 7=Most Confident)", 250 - (textWidth("Participant Confidence (1=Least Confident, 7=Most Confident)")/2.0),615); save("/InfoVisFigures/Exp3pBox.png"); background(255); size(500,625); // System.out.println("Figure 8c"); fig = new Chart(50,10,450,575); fig.setAxis("Average p-value of presented graph (two sample t-test)",0.0,0.35,0.05,0.01); fig.setGap(5); fig.addViolin(new Violin(0.1315765,#fc8d62,(0.1650846-0.0980684)/2.0,34,"1")); fig.addViolin(new Violin(0.0845777,#fc8d62,(0.1056931-0.0634622)/2.0,59,"2")); fig.addViolin(new Violin(0.0810771,#fc8d62,(0.100674-0.0614802)/2.0,66,"3")); fig.addViolin(new Violin(0.0887978,#fc8d62,(0.1072454-0.0703501)/2.0,101,"4")); fig.addViolin(new Violin(0.0591208,#fc8d62,(0.0698878-0.0483538)/2.0,206,"5")); fig.addViolin(new Violin(0.0298576,#fc8d62,(0.0390978-0.0206174)/2.0,174,"6")); fig.addViolin(new Violin(0.0125898,#fc8d62,(0.0181681-0.0070116)/2.0,216,"7")); fig.draw(); text("Participant Confidence (1=Least Confident, 7=Most Confident)", 250 - (textWidth("Participant Confidence (1=Least Confident, 7=Most Confident)")/2.0),615); save("/InfoVisFigures/Exp3pGradient.png"); background(255); size(500,625); // System.out.println("Figure 8d"); fig = new Chart(50,10,450,575); fig.setAxis("Average p-value of presented graph (two sample t-test)",0.0,0.35,0.05,0.01); fig.setGap(5); fig.addViolin(new Violin(0.1676684,#8da0cb,(0.2451276-0.0902092)/2.0,9,"1")); fig.addViolin(new Violin(0.1224855,#8da0cb,(0.1489727-0.0959983)/2.0,46,"2")); fig.addViolin(new Violin(0.0889436,#8da0cb,(0.108654-0.0692332)/2.0,66,"3")); fig.addViolin(new Violin(0.0794416,#8da0cb,(0.0921979-0.0666854)/2.0,172,"4")); fig.addViolin(new Violin(0.050544,#8da0cb,(0.0604034-0.0406846)/2.0,241,"5")); fig.addViolin(new Violin(0.0158756,#8da0cb,(0.0216878-0.0100634)/2.0,181,"6")); fig.addViolin(new Violin(0.0180513,#8da0cb,(0.0262072-0.0098954)/2.0,157,"7")); fig.draw(); text("Participant Confidence (1=Least Confident, 7=Most Confident)", 250 - (textWidth("Participant Confidence (1=Least Confident, 7=Most Confident)")/2.0),615); save("/InfoVisFigures/Exp3pViolin.png"); } void draw(){ }