Discussion:
x-axis tick marks length in ggplot2
'Maria Lathouri' via ggplot2
2018-06-27 16:17:38 UTC
Permalink
Dear all,


I would like to ask if there is a way to increase the length of the tick marks on the x-axis only.


I got the code:

p+ theme(axis.ticks.length=unit(.30, "cm"))

but this increases the length for both x and y axis; whereas, I would like only on x-axis.


Thank you very much in advance.


Kind regards,
Maria
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Abhimanyu Khatry
2018-06-28 05:07:36 UTC
Permalink
How a beginner can get started on ggplot ? Is it right to start this if
someone is new to data science ?

On Wed, Jun 27, 2018 at 9:47 PM, 'Maria Lathouri' via ggplot2 <
Post by 'Maria Lathouri' via ggplot2
Dear all,
I would like to ask if there is a way to increase the length of the tick
marks on the x-axis only.
p+ theme(axis.ticks.length=unit(.30, "cm"))
but this increases the length for both x and y axis; whereas, I would like only on x-axis.
Thank you very much in advance.
Kind regards,
Maria
--
--
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
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
For more options, visit https://groups.google.com/d/optout.
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Maria Lathouri' via ggplot2
2018-06-28 11:48:54 UTC
Permalink
Dear Abhimanyu,

If I am not mistaken, this online help is to post questions, and if possible, these questions to be answered. NOT for sarcastic and insulting posts. You could have just easily ignored my question. So simple.    

Kind regards,Maria

Στις 12:38 ÎŒ.ÎŒ. ΠέΌπτη, 28 ΙουΜίου 2018, ο/η Maria Lathouri <***@yahoo.gr> έγραψε:


I am sorry but I didn't get your point. And I am not new in data science!!

Maria

Στις 11:38 π.ÎŒ. ΠέΌπτη, 28 ΙουΜίου 2018, ο/η Abhimanyu Khatry <***@gmail.com> έγραψε:


How a beginner can get started on ggplot ? Is it right to start this if someone is new to data science ?
On Wed, Jun 27, 2018 at 9:47 PM, 'Maria Lathouri' via ggplot2 <***@googlegroups.com> wrote:

Dear all,


I would like to ask if there is a way to increase the length of the tick marks on the x-axis only.


I got the code:

p+ theme(axis.ticks.length=unit(. 30, "cm"))

but this increases the length for both x and y axis; whereas, I would like only on x-axis.


Thank you very much in advance.


Kind regards,
Maria
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+unsubscribe@ 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.
For more options, visit https://groups.google.com/d/ optout.
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ron Crump
2018-06-28 12:39:14 UTC
Permalink
Dear Maria,
Post by 'Maria Lathouri' via ggplot2
If I am not mistaken, this online help is to post questions, and if
possible, these questions to be answered. NOT for sarcastic and
insulting posts. You could have just easily ignored my question. So simple.
My interpretation of Abhimanyu's post was not that it was
aimed at you, but that it was a genuine question (that is,
Abhimanyu is new to data science and wants to know how to get
started and whether this is appropriate at this stage).

Abhimanyu, it is not good practice to hijack somebody else's
thread - it is rude and can lead to misunderstandings, as in
this case, I believe.

Maria:
I'm sorry I don't know the answer to your original
question, but I'm thinking about it. What are you planning
on doing with the y-axis ticks? What is your reason
for wanting the x and y axis ticks to be different lengths?
Post by 'Maria Lathouri' via ggplot2
How a beginner can get started on ggplot? Is it right to start this if
someone is new to data science ?
Abhimanyu:
This list is for help with ggplot2 problems.

Most of the people on this list will be ggplot2 users
and keen on it's use, so this may not be the best place
to look for a truly balanced view point on whether or
not to learn it now. Personally, I'd go for it.

You might find the community.rstudio.com forums a better
option for this type of question.

To get started with ggplot, you could search for ggplot2
tutorials on the internet and look at some examples on the
internet, eg at http://www.jvcasillas.com/base_lattice_ggplot/
which uses ggplot2, lattice and base graphics or
http://www.cookbook-r.com/Graphs/ which is ggplot2 based.

If you reply to this email, please change the subject line
in order to differentiate it from Maria's question.

Ron.
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Bri On
2018-06-28 13:00:38 UTC
Permalink
Dear Maria,
you are correct. This list is to get help with ggplot.
The message from Khatry is cryptic indeed. If I may, I think you have misunderstood Khatry. I understood it that this person is asking for a tip on how to start with ggplot, or whether one should start with ggplot if one is new to data science. If this is so, you may have understood an admirer seeking help as a person who means to harrass you.
Regarding your question, I am a little rusty, but don't recall that there is an option. However, I can modify the x-ticks with the following.
library(ggplot2)p1 <- ggplot(mtcars, aes(wt, mpg)) +  geom_point() +  labs(title = "Fuel economy declines as weight increases")p1 + theme(axis.ticks.x = element_line(colour='black', size = unit(.5, "cm")))
Now I would need to figure out why it only modifies certain ticks. As I said I am a little rusty.
Cheers,Brian
Post by 'Maria Lathouri' via ggplot2
Dear Abhimanyu,
If I am not mistaken, this online help is to post questions, and if possible, these questions to be answered. NOT for sarcastic and insulting posts. You could have just easily ignored my question. So simple.    
Kind regards,
Maria
I am sorry but I didn't get your point. And I am not new in data science!!
Maria
How a beginner can get started on ggplot ? Is it right to start this if someone is new to data science ?
Dear all,
I would like to ask if there is a way to increase the length of the tick marks on the x-axis only.
p+ theme(axis.ticks.length=unit(. 30, "cm"))
but this increases the length for both x and y axis; whereas, I would like only on x-axis.
Thank you very much in advance.
Kind regards,
Maria
--
--
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
More options: http://groups.google.com/ group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
For more options, visit https://groups.google.com/d/ optout.
--
--
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
 
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
For more options, visit https://groups.google.com/d/optout.
--
--
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
 
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
For more options, visit https://groups.google.com/d/optout.
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Maria Lathouri' via ggplot2
2018-06-28 13:29:45 UTC
Permalink
Dear Abhimanyu and all,
I am really sorry for this; I thought that his comment was addressing to me since he replied to my question and I felt a bit insulted. I truly apologize for the misunderstanding.

The theme(axis.ticks.x=element_line() ) makes a horizontal line on the x-axis. I have been struggling to find a way to change just the tick length of one axis but with no luck. I think that there is no option.

Many thanks,Maria




Στις 2:00 ÎŒ.ÎŒ. ΠέΌπτη, 28 ΙουΜίου 2018, ο/η Bri On <***@gmail.com> έγραψε:


Dear Maria,
you are correct. This list is to get help with ggplot.
The message from Khatry is cryptic indeed. If I may, I think you have misunderstood Khatry. I understood it that this person is asking for a tip on how to start with ggplot, or whether one should start with ggplot if one is new to data science. If this is so, you may have understood an admirer seeking help as a person who means to harrass you.
Regarding your question, I am a little rusty, but don't recall that there is an option. However, I can modify the x-ticks with the following.
library(ggplot2)p1 <- ggplot(mtcars, aes(wt, mpg)) +  geom_point() +  labs(title = "Fuel economy declines as weight increases")p1 + theme(axis.ticks.x = element_line(colour='black', size = unit(.5, "cm")))
Now I would need to figure out why it only modifies certain ticks. As I said I am a little rusty.
Cheers,Brian
On Thu, 2018-06-28 at 11:48 +0000, 'Maria Lathouri' via ggplot2 wrote:
Dear Abhimanyu,

If I am not mistaken, this online help is to post questions, and if possible, these questions to be answered. NOT for sarcastic and insulting posts. You could have just easily ignored my question. So simple.    

Kind regards,Maria

Στις 12:38 ÎŒ.ÎŒ. ΠέΌπτη, 28 ΙουΜίου 2018, ο/η Maria Lathouri <***@yahoo.gr> έγραψε:


I am sorry but I didn't get your point. And I am not new in data science!!

Maria

Στις 11:38 π.ÎŒ. ΠέΌπτη, 28 ΙουΜίου 2018, ο/η Abhimanyu Khatry <***@gmail.com> έγραψε:


How a beginner can get started on ggplot ? Is it right to start this if someone is new to data science ?
On Wed, Jun 27, 2018 at 9:47 PM, 'Maria Lathouri' via ggplot2 <***@googlegroups.com> wrote:

Dear all,


I would like to ask if there is a way to increase the length of the tick marks on the x-axis only.


I got the code:

p+ theme(axis.ticks.length=unit(. 30, "cm"))

but this increases the length for both x and y axis; whereas, I would like only on x-axis.


Thank you very much in advance.


Kind regards,
Maria
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+unsubscribe@ 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.
For more options, visit https://groups.google.com/d/ optout.
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
James F. Henson
2018-06-28 17:04:09 UTC
Permalink
Hello Maria,

There are many tutorials on ggplot2. Here is one.

Introduction to R Graphics with ggplot2
http://tutorials.iq.harvard.edu/R/Rgraphics/Rgraphics.html


Best regards,
James



From: ***@googlegroups.com [mailto:***@googlegroups.com] On Behalf Of Abhimanyu Khatry
Sent: Thursday, June 28, 2018 12:08 AM
To: ***@googlegroups.com
Subject: Re: x-axis tick marks length in ggplot2

How a beginner can get started on ggplot ? Is it right to start this if someone is new to data science ?

On Wed, Jun 27, 2018 at 9:47 PM, 'Maria Lathouri' via ggplot2 <***@googlegroups.com<mailto:***@googlegroups.com>> wrote:
Dear all,


I would like to ask if there is a way to increase the length of the tick marks on the x-axis only.


I got the code:

p+ theme(axis.ticks.length=unit(.30, "cm"))

but this increases the length for both x and y axis; whereas, I would like only on x-axis.


Thank you very much in advance.


Kind regards,
Maria

--
--
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 ***@googlegroups.com<mailto:***@googlegroups.com>
To unsubscribe: email ggplot2+***@googlegroups.com<mailto:ggplot2%***@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+***@googlegroups.com<mailto:ggplot2%***@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

--
--
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 ***@googlegroups.com<mailto:***@googlegroups.com>
To unsubscribe: email ggplot2+***@googlegroups.com<mailto:ggplot2+***@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+***@googlegroups.com<mailto:ggplot2+***@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
[Loading Image...]
SU Smiles!
Excellent Customer Service is our Goal.
Tell us how we are doing! Click Here.
Click Here!<https://surveys.subr.edu/classclimate/online.php?p=TN1JT>
[http://www.sus.edu/Images/Interior/smiley.png]
SU Smiles!
Excellent Customer Service is our Goal.
Tell us how we are doing! Click Here.
Click Here!<https://surveys.subr.edu/classclimate/online.php?p=TN1JT>
--
--
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 ***@googlegroups.com
To unsubscribe: email ggplot2+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...