The data zone for the given postcode is found by querying the SPARQL endpoint of statistics.gov.scot. The data zone shapefile is then downloaded from spatialdata.gov.scot and plotted with tmap.
This repository is available under the Open Government Licence v3.0.