diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b0d1972..37d09c7 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,9 +6,9 @@ version: 2 # Set the version of Python and other tools you might need build: - os: ubuntu-20.04 + os: ubuntu-24.04 tools: - python: "3.10" + python: "3.12" # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/Replicability_Stamp/.gitignore b/Replicability_Stamp/.gitignore new file mode 100644 index 0000000..ad17c78 --- /dev/null +++ b/Replicability_Stamp/.gitignore @@ -0,0 +1,4 @@ +miniconda3/ +env/ +mean_estimate_95.png +mpl-cache/ diff --git a/Replicability_Stamp/LIABILITY_FORM.txt b/Replicability_Stamp/LIABILITY_FORM.txt new file mode 100644 index 0000000..45c633f --- /dev/null +++ b/Replicability_Stamp/LIABILITY_FORM.txt @@ -0,0 +1,8 @@ +LIABILITY FORM for the Graphics Replicability Stamp Initiative (GRSI) + +Paper title: A General Approach to Visualizing Uncertainty in Statistical + Graphics +Venue: IEEE Transactions on Visualization and Computer Graphics +Authors: Bernarda Petek, David Nabergoj, Erik Strumbelj + +We, the authors of the above paper, give permission to the Replicability Committee and its reviewers to review the code and advertise the review publicly after the stamp is approved. \ No newline at end of file diff --git a/Replicability_Stamp/README.txt b/Replicability_Stamp/README.txt new file mode 100644 index 0000000..6610016 --- /dev/null +++ b/Replicability_Stamp/README.txt @@ -0,0 +1,33 @@ +Title: A General Approach to Visualizing Uncertainty in Statistical Graphics +Authors: Bernarda Petek, David Nabergoj, Erik Strumbelj +Venue: IEEE Transactions on Visualization and Computer Graphics +Operating system: macOS 11 or newer +Code repository: https://github.com/davidnabergoj/bootplot (this submission is the Replicability_Stamp directory inside it) +Reproduced result: Figure 6, left-hand image, produced by our approach that shows 95% confidence intervals for mean bill length per penguin species, created with bootplot, n = 39 samples. + +======================================================================== +This is a submission for the Graphics Replicability Stamp Initiative (GRSI). Please refer to https://www.replicabilitystamp.org for more information. + +WHAT THIS DIRECTORY CONTAINS +------------------------------------------------------------------------ +1. install_dependencies.sh -- installs all dependencies (including bootplot) and runs the Python script below. +2. reproduce_figure6.py -- Python script that runs bootplot to produce the figure. +3. penguins.csv -- the dataset used by our method to produce the figure (Palmer penguins, CC0 license). +4. README.txt -- this file: description and instructions. +5. LIABILITY_FORM.txt -- the liability form. + +HOW TO RUN THE SCRIPT +------------------------------------------------------------------------ +On macOS 11 or newer, open a terminal (for example, the built-in Terminal.app) and run the script by giving bash its path. For example, if you cloned the repository into your Downloads folder: + + bash ~/Downloads/bootplot/Replicability_Stamp/install_dependencies.sh + +(~ is your home folder: /Users/; adjust the path to wherever you cloned the repository). That is the only command needed. After a few minutes, the reproduced figure opens in Preview and is saved next to the script as mean_estimate_95.png. No administrator password is needed, and nothing is asked during the run, but macOS may ask for permission to access the folder (depending on the folder). For example, if the repository is in Downloads, click OK. + +WHAT THE SCRIPT DOES, STEP BY STEP +------------------------------------------------------------------------ +1. Downloads Miniconda from Anaconda's official server (repo.anaconda.com), automatically choosing the Apple Silicon or Intel build. +2. Installs Miniconda into the subfolder named miniconda3, inside this directory. Hence, nothing is written into system folders or the home directory, and no administrator password is ever needed. +3. Creates a Python environment in the subfolder named env containing Python 3.12, pip, and pycairo from the conda-forge channel. Figures are rendered with matplotlib's cairo backend, the backend used for the figures in the paper (it allows disabling anti-aliasing, as the paper recommends). conda-forge provides pycairo prebuilt with the cairo graphics library bundled in, so nothing is compiled on your machine. +4. Installs the bootplot library (version 0.0.18) from PyPI into that environment. Installing bootplot automatically brings its own dependencies (numpy, pandas, matplotlib, and others). +5. Runs reproduce_figure6.py with no parameters. The script reads the bundled penguins.csv, applies bootplot with n = 39 resamples, which yields 95% coverage (Table I in the paper), saves the aggregate image to mean_estimate_95.png, and opens it in Preview. On success, the final output message is: "Done. The figure was saved as mean_estimate_95.png in this directory." diff --git a/Replicability_Stamp/install_dependencies.sh b/Replicability_Stamp/install_dependencies.sh new file mode 100644 index 0000000..b1caa1c --- /dev/null +++ b/Replicability_Stamp/install_dependencies.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Installs everything needed to reproduce Figure 6 into THIS directory. +# Vanilla macOS 11+, no admin password, no prompts, no system changes. +# Run from the replicability directory: bash install_dependencies.sh +set -e +cd "$(dirname "$0")" + +# Miniconda (self-contained Python; picks Apple Silicon or Intel build) +curl -L -o miniconda.sh "https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-$(uname -m).sh" +bash miniconda.sh -b -u -p ./miniconda3 && rm miniconda.sh + +# Do not register this local environment in the user's ~/.conda/environments.txt +# This avoids intentionally modifying conda bookkeeping files outside this directory. +export CONDA_REGISTER_ENVS=false + +# Python 3.12 + pip + pycairo (prebuilt, bundles the cairo library), then bootplot +rm -rf ./env +./miniconda3/bin/conda create -y -p ./env --override-channels -c conda-forge python=3.12 pip pycairo +./env/bin/pip install --no-cache-dir "bootplot==0.0.18" + +# Reproduce the figure and show it +./env/bin/python reproduce_figure6.py +open mean_estimate_95.png +echo "Done. The figure was saved as mean_estimate_95.png in this directory." diff --git a/Replicability_Stamp/penguins.csv b/Replicability_Stamp/penguins.csv new file mode 100644 index 0000000..b3bfad2 --- /dev/null +++ b/Replicability_Stamp/penguins.csv @@ -0,0 +1,345 @@ +species,island,bill_length_mm,bill_depth_mm,flipper_length_mm,body_mass_g,sex,year +Adelie,Torgersen,39.1,18.7,181.0,3750.0,male,2007 +Adelie,Torgersen,39.5,17.4,186.0,3800.0,female,2007 +Adelie,Torgersen,40.3,18.0,195.0,3250.0,female,2007 +Adelie,Torgersen,,,,,,2007 +Adelie,Torgersen,36.7,19.3,193.0,3450.0,female,2007 +Adelie,Torgersen,39.3,20.6,190.0,3650.0,male,2007 +Adelie,Torgersen,38.9,17.8,181.0,3625.0,female,2007 +Adelie,Torgersen,39.2,19.6,195.0,4675.0,male,2007 +Adelie,Torgersen,34.1,18.1,193.0,3475.0,,2007 +Adelie,Torgersen,42.0,20.2,190.0,4250.0,,2007 +Adelie,Torgersen,37.8,17.1,186.0,3300.0,,2007 +Adelie,Torgersen,37.8,17.3,180.0,3700.0,,2007 +Adelie,Torgersen,41.1,17.6,182.0,3200.0,female,2007 +Adelie,Torgersen,38.6,21.2,191.0,3800.0,male,2007 +Adelie,Torgersen,34.6,21.1,198.0,4400.0,male,2007 +Adelie,Torgersen,36.6,17.8,185.0,3700.0,female,2007 +Adelie,Torgersen,38.7,19.0,195.0,3450.0,female,2007 +Adelie,Torgersen,42.5,20.7,197.0,4500.0,male,2007 +Adelie,Torgersen,34.4,18.4,184.0,3325.0,female,2007 +Adelie,Torgersen,46.0,21.5,194.0,4200.0,male,2007 +Adelie,Biscoe,37.8,18.3,174.0,3400.0,female,2007 +Adelie,Biscoe,37.7,18.7,180.0,3600.0,male,2007 +Adelie,Biscoe,35.9,19.2,189.0,3800.0,female,2007 +Adelie,Biscoe,38.2,18.1,185.0,3950.0,male,2007 +Adelie,Biscoe,38.8,17.2,180.0,3800.0,male,2007 +Adelie,Biscoe,35.3,18.9,187.0,3800.0,female,2007 +Adelie,Biscoe,40.6,18.6,183.0,3550.0,male,2007 +Adelie,Biscoe,40.5,17.9,187.0,3200.0,female,2007 +Adelie,Biscoe,37.9,18.6,172.0,3150.0,female,2007 +Adelie,Biscoe,40.5,18.9,180.0,3950.0,male,2007 +Adelie,Dream,39.5,16.7,178.0,3250.0,female,2007 +Adelie,Dream,37.2,18.1,178.0,3900.0,male,2007 +Adelie,Dream,39.5,17.8,188.0,3300.0,female,2007 +Adelie,Dream,40.9,18.9,184.0,3900.0,male,2007 +Adelie,Dream,36.4,17.0,195.0,3325.0,female,2007 +Adelie,Dream,39.2,21.1,196.0,4150.0,male,2007 +Adelie,Dream,38.8,20.0,190.0,3950.0,male,2007 +Adelie,Dream,42.2,18.5,180.0,3550.0,female,2007 +Adelie,Dream,37.6,19.3,181.0,3300.0,female,2007 +Adelie,Dream,39.8,19.1,184.0,4650.0,male,2007 +Adelie,Dream,36.5,18.0,182.0,3150.0,female,2007 +Adelie,Dream,40.8,18.4,195.0,3900.0,male,2007 +Adelie,Dream,36.0,18.5,186.0,3100.0,female,2007 +Adelie,Dream,44.1,19.7,196.0,4400.0,male,2007 +Adelie,Dream,37.0,16.9,185.0,3000.0,female,2007 +Adelie,Dream,39.6,18.8,190.0,4600.0,male,2007 +Adelie,Dream,41.1,19.0,182.0,3425.0,male,2007 +Adelie,Dream,37.5,18.9,179.0,2975.0,,2007 +Adelie,Dream,36.0,17.9,190.0,3450.0,female,2007 +Adelie,Dream,42.3,21.2,191.0,4150.0,male,2007 +Adelie,Biscoe,39.6,17.7,186.0,3500.0,female,2008 +Adelie,Biscoe,40.1,18.9,188.0,4300.0,male,2008 +Adelie,Biscoe,35.0,17.9,190.0,3450.0,female,2008 +Adelie,Biscoe,42.0,19.5,200.0,4050.0,male,2008 +Adelie,Biscoe,34.5,18.1,187.0,2900.0,female,2008 +Adelie,Biscoe,41.4,18.6,191.0,3700.0,male,2008 +Adelie,Biscoe,39.0,17.5,186.0,3550.0,female,2008 +Adelie,Biscoe,40.6,18.8,193.0,3800.0,male,2008 +Adelie,Biscoe,36.5,16.6,181.0,2850.0,female,2008 +Adelie,Biscoe,37.6,19.1,194.0,3750.0,male,2008 +Adelie,Biscoe,35.7,16.9,185.0,3150.0,female,2008 +Adelie,Biscoe,41.3,21.1,195.0,4400.0,male,2008 +Adelie,Biscoe,37.6,17.0,185.0,3600.0,female,2008 +Adelie,Biscoe,41.1,18.2,192.0,4050.0,male,2008 +Adelie,Biscoe,36.4,17.1,184.0,2850.0,female,2008 +Adelie,Biscoe,41.6,18.0,192.0,3950.0,male,2008 +Adelie,Biscoe,35.5,16.2,195.0,3350.0,female,2008 +Adelie,Biscoe,41.1,19.1,188.0,4100.0,male,2008 +Adelie,Torgersen,35.9,16.6,190.0,3050.0,female,2008 +Adelie,Torgersen,41.8,19.4,198.0,4450.0,male,2008 +Adelie,Torgersen,33.5,19.0,190.0,3600.0,female,2008 +Adelie,Torgersen,39.7,18.4,190.0,3900.0,male,2008 +Adelie,Torgersen,39.6,17.2,196.0,3550.0,female,2008 +Adelie,Torgersen,45.8,18.9,197.0,4150.0,male,2008 +Adelie,Torgersen,35.5,17.5,190.0,3700.0,female,2008 +Adelie,Torgersen,42.8,18.5,195.0,4250.0,male,2008 +Adelie,Torgersen,40.9,16.8,191.0,3700.0,female,2008 +Adelie,Torgersen,37.2,19.4,184.0,3900.0,male,2008 +Adelie,Torgersen,36.2,16.1,187.0,3550.0,female,2008 +Adelie,Torgersen,42.1,19.1,195.0,4000.0,male,2008 +Adelie,Torgersen,34.6,17.2,189.0,3200.0,female,2008 +Adelie,Torgersen,42.9,17.6,196.0,4700.0,male,2008 +Adelie,Torgersen,36.7,18.8,187.0,3800.0,female,2008 +Adelie,Torgersen,35.1,19.4,193.0,4200.0,male,2008 +Adelie,Dream,37.3,17.8,191.0,3350.0,female,2008 +Adelie,Dream,41.3,20.3,194.0,3550.0,male,2008 +Adelie,Dream,36.3,19.5,190.0,3800.0,male,2008 +Adelie,Dream,36.9,18.6,189.0,3500.0,female,2008 +Adelie,Dream,38.3,19.2,189.0,3950.0,male,2008 +Adelie,Dream,38.9,18.8,190.0,3600.0,female,2008 +Adelie,Dream,35.7,18.0,202.0,3550.0,female,2008 +Adelie,Dream,41.1,18.1,205.0,4300.0,male,2008 +Adelie,Dream,34.0,17.1,185.0,3400.0,female,2008 +Adelie,Dream,39.6,18.1,186.0,4450.0,male,2008 +Adelie,Dream,36.2,17.3,187.0,3300.0,female,2008 +Adelie,Dream,40.8,18.9,208.0,4300.0,male,2008 +Adelie,Dream,38.1,18.6,190.0,3700.0,female,2008 +Adelie,Dream,40.3,18.5,196.0,4350.0,male,2008 +Adelie,Dream,33.1,16.1,178.0,2900.0,female,2008 +Adelie,Dream,43.2,18.5,192.0,4100.0,male,2008 +Adelie,Biscoe,35.0,17.9,192.0,3725.0,female,2009 +Adelie,Biscoe,41.0,20.0,203.0,4725.0,male,2009 +Adelie,Biscoe,37.7,16.0,183.0,3075.0,female,2009 +Adelie,Biscoe,37.8,20.0,190.0,4250.0,male,2009 +Adelie,Biscoe,37.9,18.6,193.0,2925.0,female,2009 +Adelie,Biscoe,39.7,18.9,184.0,3550.0,male,2009 +Adelie,Biscoe,38.6,17.2,199.0,3750.0,female,2009 +Adelie,Biscoe,38.2,20.0,190.0,3900.0,male,2009 +Adelie,Biscoe,38.1,17.0,181.0,3175.0,female,2009 +Adelie,Biscoe,43.2,19.0,197.0,4775.0,male,2009 +Adelie,Biscoe,38.1,16.5,198.0,3825.0,female,2009 +Adelie,Biscoe,45.6,20.3,191.0,4600.0,male,2009 +Adelie,Biscoe,39.7,17.7,193.0,3200.0,female,2009 +Adelie,Biscoe,42.2,19.5,197.0,4275.0,male,2009 +Adelie,Biscoe,39.6,20.7,191.0,3900.0,female,2009 +Adelie,Biscoe,42.7,18.3,196.0,4075.0,male,2009 +Adelie,Torgersen,38.6,17.0,188.0,2900.0,female,2009 +Adelie,Torgersen,37.3,20.5,199.0,3775.0,male,2009 +Adelie,Torgersen,35.7,17.0,189.0,3350.0,female,2009 +Adelie,Torgersen,41.1,18.6,189.0,3325.0,male,2009 +Adelie,Torgersen,36.2,17.2,187.0,3150.0,female,2009 +Adelie,Torgersen,37.7,19.8,198.0,3500.0,male,2009 +Adelie,Torgersen,40.2,17.0,176.0,3450.0,female,2009 +Adelie,Torgersen,41.4,18.5,202.0,3875.0,male,2009 +Adelie,Torgersen,35.2,15.9,186.0,3050.0,female,2009 +Adelie,Torgersen,40.6,19.0,199.0,4000.0,male,2009 +Adelie,Torgersen,38.8,17.6,191.0,3275.0,female,2009 +Adelie,Torgersen,41.5,18.3,195.0,4300.0,male,2009 +Adelie,Torgersen,39.0,17.1,191.0,3050.0,female,2009 +Adelie,Torgersen,44.1,18.0,210.0,4000.0,male,2009 +Adelie,Torgersen,38.5,17.9,190.0,3325.0,female,2009 +Adelie,Torgersen,43.1,19.2,197.0,3500.0,male,2009 +Adelie,Dream,36.8,18.5,193.0,3500.0,female,2009 +Adelie,Dream,37.5,18.5,199.0,4475.0,male,2009 +Adelie,Dream,38.1,17.6,187.0,3425.0,female,2009 +Adelie,Dream,41.1,17.5,190.0,3900.0,male,2009 +Adelie,Dream,35.6,17.5,191.0,3175.0,female,2009 +Adelie,Dream,40.2,20.1,200.0,3975.0,male,2009 +Adelie,Dream,37.0,16.5,185.0,3400.0,female,2009 +Adelie,Dream,39.7,17.9,193.0,4250.0,male,2009 +Adelie,Dream,40.2,17.1,193.0,3400.0,female,2009 +Adelie,Dream,40.6,17.2,187.0,3475.0,male,2009 +Adelie,Dream,32.1,15.5,188.0,3050.0,female,2009 +Adelie,Dream,40.7,17.0,190.0,3725.0,male,2009 +Adelie,Dream,37.3,16.8,192.0,3000.0,female,2009 +Adelie,Dream,39.0,18.7,185.0,3650.0,male,2009 +Adelie,Dream,39.2,18.6,190.0,4250.0,male,2009 +Adelie,Dream,36.6,18.4,184.0,3475.0,female,2009 +Adelie,Dream,36.0,17.8,195.0,3450.0,female,2009 +Adelie,Dream,37.8,18.1,193.0,3750.0,male,2009 +Adelie,Dream,36.0,17.1,187.0,3700.0,female,2009 +Adelie,Dream,41.5,18.5,201.0,4000.0,male,2009 +Gentoo,Biscoe,46.1,13.2,211.0,4500.0,female,2007 +Gentoo,Biscoe,50.0,16.3,230.0,5700.0,male,2007 +Gentoo,Biscoe,48.7,14.1,210.0,4450.0,female,2007 +Gentoo,Biscoe,50.0,15.2,218.0,5700.0,male,2007 +Gentoo,Biscoe,47.6,14.5,215.0,5400.0,male,2007 +Gentoo,Biscoe,46.5,13.5,210.0,4550.0,female,2007 +Gentoo,Biscoe,45.4,14.6,211.0,4800.0,female,2007 +Gentoo,Biscoe,46.7,15.3,219.0,5200.0,male,2007 +Gentoo,Biscoe,43.3,13.4,209.0,4400.0,female,2007 +Gentoo,Biscoe,46.8,15.4,215.0,5150.0,male,2007 +Gentoo,Biscoe,40.9,13.7,214.0,4650.0,female,2007 +Gentoo,Biscoe,49.0,16.1,216.0,5550.0,male,2007 +Gentoo,Biscoe,45.5,13.7,214.0,4650.0,female,2007 +Gentoo,Biscoe,48.4,14.6,213.0,5850.0,male,2007 +Gentoo,Biscoe,45.8,14.6,210.0,4200.0,female,2007 +Gentoo,Biscoe,49.3,15.7,217.0,5850.0,male,2007 +Gentoo,Biscoe,42.0,13.5,210.0,4150.0,female,2007 +Gentoo,Biscoe,49.2,15.2,221.0,6300.0,male,2007 +Gentoo,Biscoe,46.2,14.5,209.0,4800.0,female,2007 +Gentoo,Biscoe,48.7,15.1,222.0,5350.0,male,2007 +Gentoo,Biscoe,50.2,14.3,218.0,5700.0,male,2007 +Gentoo,Biscoe,45.1,14.5,215.0,5000.0,female,2007 +Gentoo,Biscoe,46.5,14.5,213.0,4400.0,female,2007 +Gentoo,Biscoe,46.3,15.8,215.0,5050.0,male,2007 +Gentoo,Biscoe,42.9,13.1,215.0,5000.0,female,2007 +Gentoo,Biscoe,46.1,15.1,215.0,5100.0,male,2007 +Gentoo,Biscoe,44.5,14.3,216.0,4100.0,,2007 +Gentoo,Biscoe,47.8,15.0,215.0,5650.0,male,2007 +Gentoo,Biscoe,48.2,14.3,210.0,4600.0,female,2007 +Gentoo,Biscoe,50.0,15.3,220.0,5550.0,male,2007 +Gentoo,Biscoe,47.3,15.3,222.0,5250.0,male,2007 +Gentoo,Biscoe,42.8,14.2,209.0,4700.0,female,2007 +Gentoo,Biscoe,45.1,14.5,207.0,5050.0,female,2007 +Gentoo,Biscoe,59.6,17.0,230.0,6050.0,male,2007 +Gentoo,Biscoe,49.1,14.8,220.0,5150.0,female,2008 +Gentoo,Biscoe,48.4,16.3,220.0,5400.0,male,2008 +Gentoo,Biscoe,42.6,13.7,213.0,4950.0,female,2008 +Gentoo,Biscoe,44.4,17.3,219.0,5250.0,male,2008 +Gentoo,Biscoe,44.0,13.6,208.0,4350.0,female,2008 +Gentoo,Biscoe,48.7,15.7,208.0,5350.0,male,2008 +Gentoo,Biscoe,42.7,13.7,208.0,3950.0,female,2008 +Gentoo,Biscoe,49.6,16.0,225.0,5700.0,male,2008 +Gentoo,Biscoe,45.3,13.7,210.0,4300.0,female,2008 +Gentoo,Biscoe,49.6,15.0,216.0,4750.0,male,2008 +Gentoo,Biscoe,50.5,15.9,222.0,5550.0,male,2008 +Gentoo,Biscoe,43.6,13.9,217.0,4900.0,female,2008 +Gentoo,Biscoe,45.5,13.9,210.0,4200.0,female,2008 +Gentoo,Biscoe,50.5,15.9,225.0,5400.0,male,2008 +Gentoo,Biscoe,44.9,13.3,213.0,5100.0,female,2008 +Gentoo,Biscoe,45.2,15.8,215.0,5300.0,male,2008 +Gentoo,Biscoe,46.6,14.2,210.0,4850.0,female,2008 +Gentoo,Biscoe,48.5,14.1,220.0,5300.0,male,2008 +Gentoo,Biscoe,45.1,14.4,210.0,4400.0,female,2008 +Gentoo,Biscoe,50.1,15.0,225.0,5000.0,male,2008 +Gentoo,Biscoe,46.5,14.4,217.0,4900.0,female,2008 +Gentoo,Biscoe,45.0,15.4,220.0,5050.0,male,2008 +Gentoo,Biscoe,43.8,13.9,208.0,4300.0,female,2008 +Gentoo,Biscoe,45.5,15.0,220.0,5000.0,male,2008 +Gentoo,Biscoe,43.2,14.5,208.0,4450.0,female,2008 +Gentoo,Biscoe,50.4,15.3,224.0,5550.0,male,2008 +Gentoo,Biscoe,45.3,13.8,208.0,4200.0,female,2008 +Gentoo,Biscoe,46.2,14.9,221.0,5300.0,male,2008 +Gentoo,Biscoe,45.7,13.9,214.0,4400.0,female,2008 +Gentoo,Biscoe,54.3,15.7,231.0,5650.0,male,2008 +Gentoo,Biscoe,45.8,14.2,219.0,4700.0,female,2008 +Gentoo,Biscoe,49.8,16.8,230.0,5700.0,male,2008 +Gentoo,Biscoe,46.2,14.4,214.0,4650.0,,2008 +Gentoo,Biscoe,49.5,16.2,229.0,5800.0,male,2008 +Gentoo,Biscoe,43.5,14.2,220.0,4700.0,female,2008 +Gentoo,Biscoe,50.7,15.0,223.0,5550.0,male,2008 +Gentoo,Biscoe,47.7,15.0,216.0,4750.0,female,2008 +Gentoo,Biscoe,46.4,15.6,221.0,5000.0,male,2008 +Gentoo,Biscoe,48.2,15.6,221.0,5100.0,male,2008 +Gentoo,Biscoe,46.5,14.8,217.0,5200.0,female,2008 +Gentoo,Biscoe,46.4,15.0,216.0,4700.0,female,2008 +Gentoo,Biscoe,48.6,16.0,230.0,5800.0,male,2008 +Gentoo,Biscoe,47.5,14.2,209.0,4600.0,female,2008 +Gentoo,Biscoe,51.1,16.3,220.0,6000.0,male,2008 +Gentoo,Biscoe,45.2,13.8,215.0,4750.0,female,2008 +Gentoo,Biscoe,45.2,16.4,223.0,5950.0,male,2008 +Gentoo,Biscoe,49.1,14.5,212.0,4625.0,female,2009 +Gentoo,Biscoe,52.5,15.6,221.0,5450.0,male,2009 +Gentoo,Biscoe,47.4,14.6,212.0,4725.0,female,2009 +Gentoo,Biscoe,50.0,15.9,224.0,5350.0,male,2009 +Gentoo,Biscoe,44.9,13.8,212.0,4750.0,female,2009 +Gentoo,Biscoe,50.8,17.3,228.0,5600.0,male,2009 +Gentoo,Biscoe,43.4,14.4,218.0,4600.0,female,2009 +Gentoo,Biscoe,51.3,14.2,218.0,5300.0,male,2009 +Gentoo,Biscoe,47.5,14.0,212.0,4875.0,female,2009 +Gentoo,Biscoe,52.1,17.0,230.0,5550.0,male,2009 +Gentoo,Biscoe,47.5,15.0,218.0,4950.0,female,2009 +Gentoo,Biscoe,52.2,17.1,228.0,5400.0,male,2009 +Gentoo,Biscoe,45.5,14.5,212.0,4750.0,female,2009 +Gentoo,Biscoe,49.5,16.1,224.0,5650.0,male,2009 +Gentoo,Biscoe,44.5,14.7,214.0,4850.0,female,2009 +Gentoo,Biscoe,50.8,15.7,226.0,5200.0,male,2009 +Gentoo,Biscoe,49.4,15.8,216.0,4925.0,male,2009 +Gentoo,Biscoe,46.9,14.6,222.0,4875.0,female,2009 +Gentoo,Biscoe,48.4,14.4,203.0,4625.0,female,2009 +Gentoo,Biscoe,51.1,16.5,225.0,5250.0,male,2009 +Gentoo,Biscoe,48.5,15.0,219.0,4850.0,female,2009 +Gentoo,Biscoe,55.9,17.0,228.0,5600.0,male,2009 +Gentoo,Biscoe,47.2,15.5,215.0,4975.0,female,2009 +Gentoo,Biscoe,49.1,15.0,228.0,5500.0,male,2009 +Gentoo,Biscoe,47.3,13.8,216.0,4725.0,,2009 +Gentoo,Biscoe,46.8,16.1,215.0,5500.0,male,2009 +Gentoo,Biscoe,41.7,14.7,210.0,4700.0,female,2009 +Gentoo,Biscoe,53.4,15.8,219.0,5500.0,male,2009 +Gentoo,Biscoe,43.3,14.0,208.0,4575.0,female,2009 +Gentoo,Biscoe,48.1,15.1,209.0,5500.0,male,2009 +Gentoo,Biscoe,50.5,15.2,216.0,5000.0,female,2009 +Gentoo,Biscoe,49.8,15.9,229.0,5950.0,male,2009 +Gentoo,Biscoe,43.5,15.2,213.0,4650.0,female,2009 +Gentoo,Biscoe,51.5,16.3,230.0,5500.0,male,2009 +Gentoo,Biscoe,46.2,14.1,217.0,4375.0,female,2009 +Gentoo,Biscoe,55.1,16.0,230.0,5850.0,male,2009 +Gentoo,Biscoe,44.5,15.7,217.0,4875.0,,2009 +Gentoo,Biscoe,48.8,16.2,222.0,6000.0,male,2009 +Gentoo,Biscoe,47.2,13.7,214.0,4925.0,female,2009 +Gentoo,Biscoe,,,,,,2009 +Gentoo,Biscoe,46.8,14.3,215.0,4850.0,female,2009 +Gentoo,Biscoe,50.4,15.7,222.0,5750.0,male,2009 +Gentoo,Biscoe,45.2,14.8,212.0,5200.0,female,2009 +Gentoo,Biscoe,49.9,16.1,213.0,5400.0,male,2009 +Chinstrap,Dream,46.5,17.9,192.0,3500.0,female,2007 +Chinstrap,Dream,50.0,19.5,196.0,3900.0,male,2007 +Chinstrap,Dream,51.3,19.2,193.0,3650.0,male,2007 +Chinstrap,Dream,45.4,18.7,188.0,3525.0,female,2007 +Chinstrap,Dream,52.7,19.8,197.0,3725.0,male,2007 +Chinstrap,Dream,45.2,17.8,198.0,3950.0,female,2007 +Chinstrap,Dream,46.1,18.2,178.0,3250.0,female,2007 +Chinstrap,Dream,51.3,18.2,197.0,3750.0,male,2007 +Chinstrap,Dream,46.0,18.9,195.0,4150.0,female,2007 +Chinstrap,Dream,51.3,19.9,198.0,3700.0,male,2007 +Chinstrap,Dream,46.6,17.8,193.0,3800.0,female,2007 +Chinstrap,Dream,51.7,20.3,194.0,3775.0,male,2007 +Chinstrap,Dream,47.0,17.3,185.0,3700.0,female,2007 +Chinstrap,Dream,52.0,18.1,201.0,4050.0,male,2007 +Chinstrap,Dream,45.9,17.1,190.0,3575.0,female,2007 +Chinstrap,Dream,50.5,19.6,201.0,4050.0,male,2007 +Chinstrap,Dream,50.3,20.0,197.0,3300.0,male,2007 +Chinstrap,Dream,58.0,17.8,181.0,3700.0,female,2007 +Chinstrap,Dream,46.4,18.6,190.0,3450.0,female,2007 +Chinstrap,Dream,49.2,18.2,195.0,4400.0,male,2007 +Chinstrap,Dream,42.4,17.3,181.0,3600.0,female,2007 +Chinstrap,Dream,48.5,17.5,191.0,3400.0,male,2007 +Chinstrap,Dream,43.2,16.6,187.0,2900.0,female,2007 +Chinstrap,Dream,50.6,19.4,193.0,3800.0,male,2007 +Chinstrap,Dream,46.7,17.9,195.0,3300.0,female,2007 +Chinstrap,Dream,52.0,19.0,197.0,4150.0,male,2007 +Chinstrap,Dream,50.5,18.4,200.0,3400.0,female,2008 +Chinstrap,Dream,49.5,19.0,200.0,3800.0,male,2008 +Chinstrap,Dream,46.4,17.8,191.0,3700.0,female,2008 +Chinstrap,Dream,52.8,20.0,205.0,4550.0,male,2008 +Chinstrap,Dream,40.9,16.6,187.0,3200.0,female,2008 +Chinstrap,Dream,54.2,20.8,201.0,4300.0,male,2008 +Chinstrap,Dream,42.5,16.7,187.0,3350.0,female,2008 +Chinstrap,Dream,51.0,18.8,203.0,4100.0,male,2008 +Chinstrap,Dream,49.7,18.6,195.0,3600.0,male,2008 +Chinstrap,Dream,47.5,16.8,199.0,3900.0,female,2008 +Chinstrap,Dream,47.6,18.3,195.0,3850.0,female,2008 +Chinstrap,Dream,52.0,20.7,210.0,4800.0,male,2008 +Chinstrap,Dream,46.9,16.6,192.0,2700.0,female,2008 +Chinstrap,Dream,53.5,19.9,205.0,4500.0,male,2008 +Chinstrap,Dream,49.0,19.5,210.0,3950.0,male,2008 +Chinstrap,Dream,46.2,17.5,187.0,3650.0,female,2008 +Chinstrap,Dream,50.9,19.1,196.0,3550.0,male,2008 +Chinstrap,Dream,45.5,17.0,196.0,3500.0,female,2008 +Chinstrap,Dream,50.9,17.9,196.0,3675.0,female,2009 +Chinstrap,Dream,50.8,18.5,201.0,4450.0,male,2009 +Chinstrap,Dream,50.1,17.9,190.0,3400.0,female,2009 +Chinstrap,Dream,49.0,19.6,212.0,4300.0,male,2009 +Chinstrap,Dream,51.5,18.7,187.0,3250.0,male,2009 +Chinstrap,Dream,49.8,17.3,198.0,3675.0,female,2009 +Chinstrap,Dream,48.1,16.4,199.0,3325.0,female,2009 +Chinstrap,Dream,51.4,19.0,201.0,3950.0,male,2009 +Chinstrap,Dream,45.7,17.3,193.0,3600.0,female,2009 +Chinstrap,Dream,50.7,19.7,203.0,4050.0,male,2009 +Chinstrap,Dream,42.5,17.3,187.0,3350.0,female,2009 +Chinstrap,Dream,52.2,18.8,197.0,3450.0,male,2009 +Chinstrap,Dream,45.2,16.6,191.0,3250.0,female,2009 +Chinstrap,Dream,49.3,19.9,203.0,4050.0,male,2009 +Chinstrap,Dream,50.2,18.8,202.0,3800.0,male,2009 +Chinstrap,Dream,45.6,19.4,194.0,3525.0,female,2009 +Chinstrap,Dream,51.9,19.5,206.0,3950.0,male,2009 +Chinstrap,Dream,46.8,16.5,189.0,3650.0,female,2009 +Chinstrap,Dream,45.7,17.0,195.0,3650.0,female,2009 +Chinstrap,Dream,55.8,19.8,207.0,4000.0,male,2009 +Chinstrap,Dream,43.5,18.1,202.0,3400.0,female,2009 +Chinstrap,Dream,49.6,18.2,193.0,3775.0,male,2009 +Chinstrap,Dream,50.8,19.0,210.0,4100.0,male,2009 +Chinstrap,Dream,50.2,18.7,198.0,3775.0,female,2009 diff --git a/Replicability_Stamp/reproduce_figure6.py b/Replicability_Stamp/reproduce_figure6.py new file mode 100644 index 0000000..ba029fd --- /dev/null +++ b/Replicability_Stamp/reproduce_figure6.py @@ -0,0 +1,72 @@ +# Reproduces Figure 6 (left-hand image) of: +# "A General Approach to Visualizing Uncertainty in Statistical Graphics" +# B. Petek, D. Nabergoj, E. Strumbelj. IEEE TVCG. +# +# The figure shows 95% confidence intervals for mean bill length for each +# penguin species, generated with bootplot (n = 39 samples). +# Runs without parameters: python reproduce_figure6.py +# Output: mean_estimate_95.png (in the current working directory) + +# Keep matplotlib's font cache inside this directory instead of ~/.matplotlib, +# so running this script leaves no files outside the replicability folder. +import os +os.environ.setdefault('MPLCONFIGDIR', os.path.join(os.path.dirname(os.path.abspath(__file__)), 'mpl-cache')) + +# Computing +import numpy as np +import pandas as pd + +# Plotting +import matplotlib +matplotlib.use("cairo") # essential: figures in the paper use the cairo backend +import matplotlib.pyplot as plt +from bootplot import bootplot + +# Styling +dpi = 300 +plt.rcParams['figure.dpi'] = dpi +plt.rcParams['ytick.labelsize'] = 12 +plt.rcParams['xtick.labelsize'] = 12 +plt.rcParams['axes.labelsize'] = 12 +plt.rcParams['legend.fontsize'] = 12 +plt.rcParams['font.size'] = 12 + +# Data (Palmer penguins, CC0; included in this repository) +csv_file_path = 'penguins.csv' +df = pd.read_csv(csv_file_path) +penguins = df.dropna() +penguins_bill_length = penguins[['species', 'bill_length_mm']] + + +# Base visualization (statistical graphic without uncertainty) +def mean_estimate(data_subset, data_full, ax): + colors = dict(zip(['Adelie', 'Chinstrap', 'Gentoo'], ['#FF8C00', '#A020F0', '#008B8B'])) + means = data_subset.groupby('species')['bill_length_mm'].mean().reindex(colors) + for i, (species, mean) in enumerate(means.items()): + if pd.notna(mean): + ax.scatter(mean, i, s=10, c=colors[species], antialiased=False,marker='s',zorder=10) + ax.set( + xlim=(33, 55), xticks=np.arange(33, 58, 5), xlabel='Bill Length', + ylim=(-0.5, 2.5), yticks=[0, 1, 2], ylabel='' + ) + ax.set_yticklabels(['Adelie', 'Chinstrap', 'Gentoo'], ha='right') + + ax.grid(axis='both', linewidth=0.5, color='#E8E8E8', zorder=-50) + ax.spines['top'].set_visible(False) + ax.spines['right'].set_visible(False) + + ax.get_figure().set_constrained_layout(True) + + +# Fix the random seed so every run draws identical resamples (deterministic output) +np.random.seed(15) + +# Apply bootplot (n = 39 samples for 95% coverage) +mat = bootplot(mean_estimate, + penguins_bill_length, + m=39, + output_image_path=f'mean_estimate_95.png', + output_size_px = (dpi*3, dpi*1.5), + verbose=True) + +print("Done. Figure written to mean_estimate_95.png") diff --git a/bootplot/__version__.py b/bootplot/__version__.py index 1f658a4..f18e5d0 100755 --- a/bootplot/__version__.py +++ b/bootplot/__version__.py @@ -1 +1 @@ -__version__ = "0.0.17" +__version__ = "0.0.18" diff --git a/docs/source/conf.py b/docs/source/conf.py index e24534b..2f5162f 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -64,7 +64,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files.