Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Update2</strong></p> <p>Actually a real reproducible example is now, thanks to code and data being provided:</p> <pre><code>d1 &lt;- read.csv(url("http://misterdavis.org/r_wiki/r_results_1231_2010")) lpp_axis1 &lt;- with(d1, data.frame("Compile Source Code" = Q3A.1, "View Source Code" = Q3A.2, "Change Source Code" = Q3A.3, "Write Documentation" = Q3A.8, "File Bug Reports"= Q3B.3, "Ask Questions" = Q3B.5, "Provide Answers" = Q3B.6, "Overall Participation" = Q3a3bConsolidated)) lpp_axis2 &lt;- with(d1, data.frame("Identification" = Q1, "Overall Learning" = Q6Consolidated, "Learning Programming" = Q6.1, "Learning about Computers" = Q6.2, "Learning Teamwork" = Q6.3)) corrplot(cor(lpp_axis1, lpp_axis2), method=c("number"), bg = "grey10", addgrid.col = "gray50", tl.cex=1, tl.col = "black", col = colorRampPalette(c("yellow","green","navyblue"))(100)) dev.new() corrplot(cor(lpp_axis1, lpp_axis2), method=c("number"), bg = "grey10", addgrid.col = "gray50", tl.cex=2, tl.col = "black", col = colorRampPalette(c("yellow","green","navyblue"))(100)) </code></pre> <p>The <code>dev.new()</code> allows you to have both on screen at once to compare, without splitting the plotting region into two panels.</p> <p>The <code>tl.offset</code> seems to cause more problems than it is worth, so I have left it out. I include the two figures below:</p> <p>With <code>tl.cex = 1</code></p> <p><img src="https://i.stack.imgur.com/II6b0.png" alt="corrplot with tl.cex = 1"></p> <p>With <code>tl.cex = 2</code></p> <p><img src="https://i.stack.imgur.com/hA1Xk.png" alt="corrplot with tl.cex = 2"></p> <p>As you can see, I can't reproduce the problem you are seeing; <code>tl.cex</code> is only changing the size of the size of the axis labels. Note this is without using <code>tl.offset</code> but the rest of the plotting code is the same as yours.</p> <p>This is what I get from <code>packageDescription()</code>:</p> <pre><code>R&gt; packageDescription("corrplot") Package: corrplot Type: Package Title: visualization of a correlation matrix Version: 0.30 Date: 2010-05-30 Author: Taiyun Wei Suggests: seriation, cairoDevice, Cairo, Maintainer: Taiyun Wei &lt;weitaiyun@gmail.com&gt; Description: The corrplot package is a graphical display of a correlation matrix, confidence interval. It also contains some algorithms to do matrix reordering. License: GPL-2 | GPL-3 LazyLoad: yes URL: http://corrplot.r-forge.r-project.org Repository: CRAN Repository/R-Forge/Project: corrplot Repository/R-Forge/Revision: 45 Date/Publication: 2010-05-31 07:44:14 Packaged: 2010-05-30 20:39:16 UTC; rforge Built: R 2.13.0; ; 2011-04-01 12:33:21 UTC; unix </code></pre> <p>-- File: /home/gavin/R/libs/corrplot/Meta/package.rds</p> <p>Compare it with the one on your system and try the example above so we are running exactly the same code for comparison.</p> <hr> <p><strong>Original Example</strong> Here is a reproducible example:</p> <pre><code>require(corrplot) data(mtcars) corr &lt;- cor(mtcars) corrplot(corr, method = "number", tl.cex = 2) </code></pre> <p><strong>Update</strong></p> <p>Ok, I see the problem now. With <code>tl.offset</code>, you push the labels away from the correlation graphic further out into the margins. This seems either a bug on infelicity in <code>corrplot()</code> as if you don't set <code>tl.offset</code> it scales the correlation graphic to accommodate the labels. The only solution I can see is to not set <code>tl.offset</code> at all, or set it to a smaller value Here is an extreme example:</p> <pre><code>layout(matrix(1:2, ncol = 2)) corrplot(corr, method = "number", tl.cex = 2, tl.offset = 3) corrplot(corr, method = "number", tl.cex = 2) layout(1) </code></pre> <p><img src="https://i.stack.imgur.com/Ll9to.png" alt="corrplot 4"></p> <p>You <em>can</em> improve things, by altering the relative dimensions of the plot device - if on screen, increase the width or height (or both) of the plot device window until all the labels are visible. If this is another device (<code>pdf()</code> or <code>png()</code> say), then you'll need to alter the dimensions of the device when you create it.</p> <hr> <p><strong>Original</strong> Which [The reproducible example] gives:</p> <p><img src="https://i.stack.imgur.com/PvuHn.png" alt="mtcars correlation plot"></p> <p>You aren't clear what the problem with the x and y axis labels, but <code>corrplot()</code> alters the plot margins to accommodate the labels. You have already stated the relative size of these x and y axis labels by setting argument <code>tl.cex = 2</code>. If you want the labels bigger, increase this value:</p> <pre><code>corrplot(corr, method = "number", tl.cex = 4) </code></pre> <p><img src="https://i.stack.imgur.com/tlqvx.png" alt="mtcars correlation plot 2"></p> <p>and if you want smaller labels, set <code>tl.cex</code> to a smaller value:</p> <pre><code>corrplot(corr, method = "number", tl.cex = 0.8) </code></pre> <p><img src="https://i.stack.imgur.com/Wy4Xy.png" alt="mtcars correlation plot 3"></p> <p>Given these are the only x <strong>and</strong> y labels on the plot, does this help? If not, <strong>which</strong> labels need altering?</p>
 

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