Created
November 8, 2016 22:48
-
-
Save gDanix/c63af39c3f429d08a1bde13da9ac7af4 to your computer and use it in GitHub Desktop.
Código en R que genera una gráfica con el dataset NY.xls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lowest_y = min(min(ny$`Warmest Minimum Temperature (C)`), min(ny$`Coldest Minimum Temperature (C)`)) | |
highest_y = max(max(ny$`Warmest Minimum Temperature (C)`), max(ny$`Coldest Minimum Temperature (C)`)) | |
plot(ny$Year, ny$`Warmest Minimum Temperature (C)`, xlim = c(min(ny$Year), 2015), xlab = "Año", ylab = "Temperatura (ºC)", main = "Temperaturas mínimas más cálidas y frías", xaxt = "n", type = "l", ylim = c(lowest_y, highest_y), col="orange") | |
lines(ny$Year, ny$`Coldest Minimum Temperature (C)`, xlim = c(min(ny$Year), 2015), type = "l", ylim = c(lowest_y, highest_y), col="cadetblue3") | |
axis(1, at=seq(1900,2015, 5), cex.axis = 0.5) | |
abline(h=seq(-10,15,2.5), lty=2) | |
legend("topleft", legend="Más cálida", col="orange", lty=1, cex=0.6) | |
legend("bottomleft", legend="Más fría", col="cadetblue3", lty=1, cex=0.6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notas:
xlim
están puestos para que el eje x comienze en el menor año y acaben siempre en el 2015.cex
tan sólo es un factor de escalado: hace que las cosas se muestren más pequeñas