Modifying labels for a tukeys HSD plot in R - r

Hi there so I'm a beginner at all this and need help modifying my Tukeys y-axis labels as they are all ontop of each other...is there a way?
Please see my code:
both<-aov(cowpea.and.wheat$Protein.conc..ug.Protein.g.1.Fwt.~cowpea.and.wheat$Treatment*Species, data=cowpea.and.wheat)
summary(both)
TukeyHSD(both)
par(mar=c(3,10,2,1))
plot(TukeyHSD(both),las=1)
image of plot:
Thank you so much for your help

try:
with(par(mai=c(1,2.5,1,1)),{plot(TukeyHSD(both), las=1,cex.axis=0.4)})
##par(mai=c(1,2.5,1,1)) adjusts the margin
##cex.axis=0.4 adjusts the axis font size relative to graph
If you could respond with a graphic (although the question was asked back months) with the above parameters, to see if my proposal is effective.
Greetings and luck!

Related

Legend in gelman.plot

I need help with the command gelman.plot of the package coda.
I would like to know if it is possible to increase the size of the legend (that indicates the median and 97.5% upper confidence limit).
I managed to increase the size of labels, title and axis values, but not of the legend.
In case this is not possible, I would like to know if there is a way to not display the legend at all.
Thank you.
I tried to solve it on my own and the only solution I found was to modify (temporarily) the function ''gelman.plot'' in the package ''coda'' using the command ''trace(gelman.plot, edit = TRUE)'' and then removing the part concerning the legend.
I post this in case anyone needs it.

R plot margins way too large when plotting networks in igraph

I've searched SO and haven't found a solution that I can get to work. I don't have any replicable data, but I've got the graph below illustrating my issue: my plot is too small. Any ideas on what my issue might be? The picture below has about half of its area as white space.
Set the margin parameter using:
par(mar=c(0,0,0,0)+.1)
See more info on par here: http://rfunction.com/archives/1302
Just in case that someone has a similar problem, you can change the margins by adding margins in plot:
plot(g, layout = layout_nicely(g),... margin=0)
See more details here: https://igraph.org/r/doc/plot.common.html

How to resize a plot (not the window) in R?

Hopefully a simple question for the community tonight:
I'm creating a boxplot with particularly long xlabels, which are rotated. The issue I'm running in to is that regardless of what plot window size I set using
dev.new(width=999, height=999)
The plot itself stretches to fill the window,and the x labels are chopped.
How do I resize the plot itself, regardless of window size?
My current plotting code is:
boxplot(mean_density~Landscape*category,ylab="Mean density",las=2,data=data1C)
The reason the X labels are so long is because of that landscape*category piece.
Thanks in advance!!
Thanks to MrFlicks quick response I managed to track down the mar() function within par().
boxplot(mean_density~Land.Cat,ylab="Mean density",las=2,data=data1C)
generated:
whereas
boxplot(mean_density~Land.Cat,ylab="Mean_density",las=2,par(mar=c(9,4,1,4)),data=data1C)
generates:
Figured it'd be an easy one:-D thanks for the help!

Change the size/dimension of graph in ggplot2 R

How do I change the size of a plot made with ggplot2?
My actual issue is: I'm using ggplot2 R to plot data in Ipython, and I have a horizontal barplot with a lot of bar to be displayed, so I want to increase the height of the graph so I can see it better.
Thanks a lot!
Maybe you should check option coord_cartesian(xlim=c(x,y), ylim=(x,y)) to rescale your graph, but if the output in Ipython is not in the demand size I think thisi rather Ipython figure height/width options-like question

qcc pareto.chart: bars are squashed - how to adjust the y axis?

I've produced a pareto.chart using the QCC package in R. In the default plot, the Y axis is scaled too large & for that reason the bars are too small. Most of the plot is wasted to empty white space. I assume this is a result of the long tail (right-skew) in the data ?
How is it possible to re-scale the Y-Axis so that the bars of the chart will be taller and more prominent (and differences between the bars more visible) ?
This is my first question and I can't post images yet. Please follow the link to an illustration of the problem:
https://www.dropbox.com/s/t8bwhmoxmwl1aic/pareto-axis.png
Thanks!
Keith
If you type help(pareto.chart) you will see there is an option ylim to specify the limits if the y-axis. If you provide some sample data I could try it out.
Otherwise, try including in your function call
pareto.chart(..., ylim=c(0,10000))
and see if that rescales your y-axis.

Resources