Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try this, redifining guide_grid.</p> <p>This solution is from the <a href="http://wiki.stdout.org/rcookbook/Graphs/Axes%20%28ggplot2%29/#Hiding_only_horizontal_or_vertical_gridlines" rel="nofollow">Cookbook for R</a></p> <pre><code># Save the original definition of the guide_grid guide_grid_orig &lt;- ggplot2:::guide_grid # Create the replacement function guide_grid_no_vline &lt;- function(theme, x.minor, x.major, y.minor, y.major) { x.minor &lt;- setdiff(x.minor, x.major) y.minor &lt;- setdiff(y.minor, y.major) ggname("grill", grobTree( theme_render(theme, "panel.background"), if(length(y.minor) &gt; 0) theme_render( theme, "panel.grid.minor", name = "y", x = rep(0:1, length(y.minor)), y = rep(y.minor, each=2), id.lengths = rep(2, length(y.minor)) ), if(length(y.major) &gt; 0) theme_render( theme, "panel.grid.major", name = "y", x = rep(0:1, length(y.major)), y = rep(y.major, each=2), id.lengths = rep(2, length(y.major)) ) )) } # Set the environment to be the same as original environment(guide_grid_no_vline) &lt;- environment(ggplot2:::guide_grid) # Assign the function inside ggplot2 assignInNamespace("guide_grid", guide_grid_no_vline, ns="ggplot2") # Draw the plot with the redefined guide_grid ggplot(CO3, aes(x=outcome)) + geom_bar(aes(x=outcome))+ facet_grid(Treatment~Type, margins='Treatment', scales='free') + theme_bw() + opts(axis.text.x=theme_text(angle= 45, vjust=1, hjust= 1)) # Restore the original guide_grid function so that it will draw all gridlines again assignInNamespace("guide_grid", guide_grid_orig, ns="ggplot2") </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload