How can I make the y axis ticks of my plot increase by multiples of 10? [duplicate]











up vote
0
down vote

favorite













This question already has an answer here:




  • Transform only one axis to log10 scale with ggplot2

    4 answers



  • ggplot scale_y_log10() issue

    1 answer




I would like to make the y axis of my histogram increase by multiples of 10 in ggplot2.



I want the values to be displayed on the y axis to be:(1, 10, 100, 1000,...1000000)



However, when I use the following code:



scale_y_continuous(breaks = c(1,10,100, 1000, 10000, 100000, 1000000))


The values on the y axis are not equally spaced! See attached image:





How can I make these values to be equally spaced on the y axis using ggplot2?



Thank you! (data are not relevant here, just the y axis ticks)










share|improve this question









New contributor




RacktheMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by Rui Barradas, phiver, zx8754 r
Users with the  r badge can single-handedly close r questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 at 20:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.











  • 3




    You'd need scale_y_log10(breaks = c(1,10,100, 1000, 10000, 100000, 1000000)) I suppose. But the outcome might need further adjustment, see ggplot scale_y_log10() issue
    – markus
    Nov 19 at 12:33










  • You can also add a labels=scales::comma parameter to the scale_ function call to get better formatting
    – hrbrmstr
    Nov 19 at 13:11










  • Thank you @markus. It works this way!
    – RacktheMan
    Nov 19 at 13:51

















up vote
0
down vote

favorite













This question already has an answer here:




  • Transform only one axis to log10 scale with ggplot2

    4 answers



  • ggplot scale_y_log10() issue

    1 answer




I would like to make the y axis of my histogram increase by multiples of 10 in ggplot2.



I want the values to be displayed on the y axis to be:(1, 10, 100, 1000,...1000000)



However, when I use the following code:



scale_y_continuous(breaks = c(1,10,100, 1000, 10000, 100000, 1000000))


The values on the y axis are not equally spaced! See attached image:





How can I make these values to be equally spaced on the y axis using ggplot2?



Thank you! (data are not relevant here, just the y axis ticks)










share|improve this question









New contributor




RacktheMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by Rui Barradas, phiver, zx8754 r
Users with the  r badge can single-handedly close r questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 at 20:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.











  • 3




    You'd need scale_y_log10(breaks = c(1,10,100, 1000, 10000, 100000, 1000000)) I suppose. But the outcome might need further adjustment, see ggplot scale_y_log10() issue
    – markus
    Nov 19 at 12:33










  • You can also add a labels=scales::comma parameter to the scale_ function call to get better formatting
    – hrbrmstr
    Nov 19 at 13:11










  • Thank you @markus. It works this way!
    – RacktheMan
    Nov 19 at 13:51















up vote
0
down vote

favorite









up vote
0
down vote

favorite












This question already has an answer here:




  • Transform only one axis to log10 scale with ggplot2

    4 answers



  • ggplot scale_y_log10() issue

    1 answer




I would like to make the y axis of my histogram increase by multiples of 10 in ggplot2.



I want the values to be displayed on the y axis to be:(1, 10, 100, 1000,...1000000)



However, when I use the following code:



scale_y_continuous(breaks = c(1,10,100, 1000, 10000, 100000, 1000000))


The values on the y axis are not equally spaced! See attached image:





How can I make these values to be equally spaced on the y axis using ggplot2?



Thank you! (data are not relevant here, just the y axis ticks)










share|improve this question









New contributor




RacktheMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












This question already has an answer here:




  • Transform only one axis to log10 scale with ggplot2

    4 answers



  • ggplot scale_y_log10() issue

    1 answer




I would like to make the y axis of my histogram increase by multiples of 10 in ggplot2.



I want the values to be displayed on the y axis to be:(1, 10, 100, 1000,...1000000)



However, when I use the following code:



scale_y_continuous(breaks = c(1,10,100, 1000, 10000, 100000, 1000000))


The values on the y axis are not equally spaced! See attached image:





How can I make these values to be equally spaced on the y axis using ggplot2?



Thank you! (data are not relevant here, just the y axis ticks)





This question already has an answer here:




  • Transform only one axis to log10 scale with ggplot2

    4 answers



  • ggplot scale_y_log10() issue

    1 answer








r ggplot2






share|improve this question









New contributor




RacktheMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




RacktheMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 19 at 13:09









hrbrmstr

58.4k584143




58.4k584143






New contributor




RacktheMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 19 at 12:26









RacktheMan

84




84




New contributor




RacktheMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





RacktheMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






RacktheMan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




marked as duplicate by Rui Barradas, phiver, zx8754 r
Users with the  r badge can single-handedly close r questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 at 20:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Rui Barradas, phiver, zx8754 r
Users with the  r badge can single-handedly close r questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 at 20:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 3




    You'd need scale_y_log10(breaks = c(1,10,100, 1000, 10000, 100000, 1000000)) I suppose. But the outcome might need further adjustment, see ggplot scale_y_log10() issue
    – markus
    Nov 19 at 12:33










  • You can also add a labels=scales::comma parameter to the scale_ function call to get better formatting
    – hrbrmstr
    Nov 19 at 13:11










  • Thank you @markus. It works this way!
    – RacktheMan
    Nov 19 at 13:51
















  • 3




    You'd need scale_y_log10(breaks = c(1,10,100, 1000, 10000, 100000, 1000000)) I suppose. But the outcome might need further adjustment, see ggplot scale_y_log10() issue
    – markus
    Nov 19 at 12:33










  • You can also add a labels=scales::comma parameter to the scale_ function call to get better formatting
    – hrbrmstr
    Nov 19 at 13:11










  • Thank you @markus. It works this way!
    – RacktheMan
    Nov 19 at 13:51










3




3




You'd need scale_y_log10(breaks = c(1,10,100, 1000, 10000, 100000, 1000000)) I suppose. But the outcome might need further adjustment, see ggplot scale_y_log10() issue
– markus
Nov 19 at 12:33




You'd need scale_y_log10(breaks = c(1,10,100, 1000, 10000, 100000, 1000000)) I suppose. But the outcome might need further adjustment, see ggplot scale_y_log10() issue
– markus
Nov 19 at 12:33












You can also add a labels=scales::comma parameter to the scale_ function call to get better formatting
– hrbrmstr
Nov 19 at 13:11




You can also add a labels=scales::comma parameter to the scale_ function call to get better formatting
– hrbrmstr
Nov 19 at 13:11












Thank you @markus. It works this way!
– RacktheMan
Nov 19 at 13:51






Thank you @markus. It works this way!
– RacktheMan
Nov 19 at 13:51



















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'