File:Petrol-ets-2010-2015.svg
Summary
| Description |
English: Analysis of the New Zealand retail petrol prices from July 2010 to the present |
| Date | |
| Source |
Own work Data obtained from Ministry of Business Innovation & Employment https://www.mbie.govt.nz/building-and-energy/energy-and-natural-resources/energy-statistics-and-modelling/energy-statistics/weekly-fuel-price-monitoring/ and https://www.mbie.govt.nz/assets/Data-Files/Energy/Weekly-fuel-price-monitoring/weekly-table.csv |
| Author | Mrfebruary |
| SVG development | |
| Source code | R codelibrary(RColorBrewer)
# read in data
data <- read.csv("https://www.mbie.govt.nz/assets/Data-Files/Energy/Weekly-fuel-price-monitoring/weekly-table.csv")
# Add a date column in date format
data[["Week_ending_Friday"]] <- as.Date(data[["Week_ending_Friday"]])
# create data frame of regular petrol price components , all rows of columns 1 and 16 to 23
petrol <- data[,c(1,16:23)]
# set some colours
display.brewer.pal("Dark2",n=5)
brewer.pal("Dark2",n=5)
[1] "#1B9E77" "#D95F02" "#7570B3" "#E7298A" "#66A61E"
tint <-c("#1B9E77", "#D95F02", "#7570B3", "#E7298A", "#66A61E")
# create chart
svg(filename ="Petrol-prices-ETS-2010-2023.svg", width = 8, height = 6, pointsize = 10, onefile = FALSE, family = "sans", bg = "white", antialias = c("default", "none", "gray", "subpixel"))
par(mar=c(4,2.9,1,1)+0.1)
plot(petrol[["Date"]],petrol[["Regular_Petrol_main_port_price_NZc.p.l"]],axes=T,ann=T, ylim=c(0,330),tck=0.01, type="l", col=tint[1],lwd=1, las=1 , ylab="",xlab="")
lines(petrol[["Date"]],petrol[["Regular_Petrol_importer_cost_NZc.p.l"]],type="l", col=tint[2],lwd=1)
lines(petrol[["Date"]],petrol[["Regular_Petrol_taxes_NZc.p.l"]],type="l", col=tint[3],lwd=1)
lines(petrol[["Date"]],petrol[["Regular_Petrol_GST_NZc.p.l"]],type="l", col=tint[4],lwd=1)
lines(petrol[["Date"]],petrol[["Regular_Petrol_ETS_NZc.p.l"]],type="l", col=tint[5],lwd=1)
legend("topleft", inset=c(0.0,0.0), cex=1.1,bty="n",c("Retail price","Import cost","Fuel excise tax","GST","Emissions trading scheme cost"), col=tint,lty=1,lwd=1)
mtext(side=4,cex=0.75, line=0.05,R.version.string)
mtext(side=1,line=2.75,cex=0.85,"Data: Ministry of Business Innovation & Employment\nhttps://www.mbie.govt.nz/assets/Data-Files/Energy/Weekly-fuel-price-monitoring/weekly-table.csv")
mtext(side=3,cex=1.6, line=-4,expression(paste("New Zealand petrol price \ncomponents 2010 to 2023")))
mtext(side=2,cex=1, line=-1.3,"cents per litre")
axis(side=4, tck=0.01, at = NULL, labels = FALSE, tick = TRUE)
dev.off()
|
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.