Adding y limit and x and y labels to ggplot/violin plot

I am trying to add a y limit and x and y labels to my ggplot/violin plot but when I type in the commands below the y axis still has a limit of 3 and the axis titles haven't changed, why is this?

biol<-ggplot(five,aes(Derivative,Score),ylim=c(0,10), xlab=("TLR4 Antagonist"), ylab=("Score"))

biol+geom_violin()+geom jitter(height=0,width=0.1)

Hi, and welcome!

Please see the FAQ: What's a reproducible example (`reprex`) and how do I do one? Using a reprex, complete with representative data will attract quicker and more answers.

A reprex should be cut, paste and play with

  1. libraries
  2. representative data
  3. code, such as what you've shown

Peeps are much more likely to offer an answer if they don't have to reverse engineer the issue

All this goes outside the ggplot() function, somethin like this

library(ggplot2)

ggplot(five,aes(Derivative, Score)) + 
    geom_violin() + 
    geom jitter(height=0, width=0.1) +
    ylim(0,10) +
    xlab("TLR4 Antagonist") +
    ylab("Score")

This is not tested since you haven't provided sample data. If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.