Alien idea
Alien idea

Reputation: 5

The x-axis gridline name does not appear on the graph

I want to graph the average monthly temperature of the Canadian weather data of the fda package. However, the x-axis gridline name does not appear.

I use canadian weather data of average monthly temperature from fda package.

op1 <- par(mar=c(5, 4, 4, 5)+.1)
stations_all <- c("St.Johns", "Halifax", "Sydney","Yarmouth","Charlottvl","Fredericton","Scheffervll","Arvida","Bagottville","Quebec","Sherbrooke","Montreal","Ottawa","Toronto","London","Thunderbay","Winnipeg","The Pas","Churchill","Regina","Pr. Albert","Uranium Cty","Edmonton","Calgary","Kamloops","Vancouver","Victoria","Pr. George","Pr. Rupert","Whitehorse","Dawson","Yellowknife","Iqaluit","Inuvik","Resolute") 
matplot(CanadianWeather$monthlyTemp,type="l", axes=FALSE, xlab="month", ylab="monthly Temperature (deg C)")
axis(2, las=1)
# Label the horizontal axis with the month names
axis(1, 1:12, labels=FALSE)
axis(1, monthMid, monthLetters)

the x-axis gridline name does not appear.

Upvotes: 0

Views: 32

Answers (1)

Ronak Shah
Ronak Shah

Reputation: 389055

You can try

library(fda)

matplot(CanadianWeather$monthlyTemp,type="l", axes=FALSE, 
        xlab="month", ylab="monthly Temperature (deg C)") 

axis(2, las=1) 
axis(1, 1:12, month.abb)

enter image description here

Upvotes: 1

Related Questions