Plotting months on the x-axis

32 views
Skip to first unread message

Money Guillaume Ossohou

unread,
Mar 14, 2017, 7:14:24 PM3/14/17
to ggplot2
Dear all,
I'm a beginner in ggplot and I want to plot the attached file. I did this but nothing:

> ggplot(plot) + aes(x=plot$Months, y=plot$`NO₂ (ppb)`)+ geom_line()
> ggplot(plot) + aes(x=plot$Months, y=plot$`NO₂ (ppb)`)+ geom_line() + scale_x_date(breaks = date_breaks("months"), labels = date_format("%b"))


plot.xlsx

Konstantinos L. Papageorgiou

unread,
Mar 15, 2017, 3:05:02 AM3/15/17
to ggp...@googlegroups.com

Hello Money,

would you like to change the column names from the xls to A,B,C,D... for less problems

then save the file to a tab delimited csv file

then read the csv file like
logDirectory<-"dirPathOfFile"
plot <- read.table(paste(logDirectory, "my.csv", sep = ""))

and retry as

ggplot(plot, aes(x=A, y=B)) + geom_line()

and build up one step at a time
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James F. Henson

unread,
Mar 15, 2017, 10:11:36 AM3/15/17
to Money Guillaume Ossohou, ggplot2

Hello Money

 

Check out Cookbook for R.

http://www.cookbook-r.com/

 

Best regards,

James

Money Guillaume Ossohou

unread,
Mar 15, 2017, 5:19:46 PM3/15/17
to James F. Henson, ggplot2
Hello James,
I could find what I was looking for, thanks to you.
         Thanks a lot!

===============================================================================
OSSOHOU Money Guillaume
LAboratoire de Physique de l'Atmosphère et de Mécanique des Fluides (LAPA-MF) d'Abidjan
Laboratoire d'Aérologie (LA) de Toulouse
Skype : money.ossohou1
=====================================================================



On 15 March 2017 at 15:17, James F. Henson <james_...@suagcenter.com> wrote:

Hello Money

 

Check out Cookbook for R.

http://www.cookbook-r.com/

 

Best regards,

James

 

From: ggp...@googlegroups.com [mailto:ggplot2@googlegroups.com] On Behalf Of Money Guillaume Ossohou
Sent: Tuesday, March 14, 2017 6:06 PM
To: ggplot2 <ggp...@googlegroups.com>
Subject: Plotting months on the x-axis

 

Dear all,
I'm a beginner in ggplot and I want to plot the attached file. I did this but nothing:


> ggplot(plot) + aes(x=plot$Months, y=plot$`NO (ppb)`)+ geom_line()
> ggplot(plot) + aes(x=plot$Months, y=plot$`NO (ppb)`)+ geom_line() + scale_x_date(breaks = date_breaks("months"), labels = date_format("%b"))

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com


More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.

To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages