1

Very new to R, have tried multiple different things and can't seem to get it. Need to reduce space between the two plots.

Any idea how to reduce that huge space between two plots?

  • When asking for plotting help you should include a [reproducible example](http://stackoverflow.com/questions/42652358/reduce-spacing-between-two-strip-plots-on-a-single-graph) with sample input data. You control the width of your plot, so my not make it more narrow? Otherwise where do you want the extra space to go? – MrFlick Mar 07 '17 at 15:41
  • I have the input data in a .csv file. Any tips on how to include this list on here? Also, for changing width, would I use par() function with lwd? – qweriesotyb12 Mar 07 '17 at 15:50
  • This link I provided has many examples of how to include data in the question itself. I'm not sure how you are making this image at all. Is this in the R GUI? RStudio? A graphics device? Often the image appears in an image window that you can just resize. – MrFlick Mar 07 '17 at 15:53
  • I am using R studio, I have just include the data I used. I am required to keep and add to the code I have above to reduce that space between the two graphs. – qweriesotyb12 Mar 07 '17 at 15:58

1 Answers1

1

By default stripchart plots the groups at x-positions 1…n. In your case, that’s at x=1 and x=2. You can control this with the at parameter:

stripchart(…, at = c(1.25, 1.75))

This for instances moves both groups inwards and makes the spacing more harmonious. Alternatively/additionally you can set the x-limits via xlim:

stripchart(…, xlim = c(0.5, 2.5))

This has a similar effect as above.

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
  • That worked perfectly, thank you. I was struggling with determining exactly at what values the two x-positions were set at by default (should have known it was 1 and 2). Much appreciated!!!!! – qweriesotyb12 Mar 07 '17 at 18:31