I am trying to plot the Venn Diagram of intersection of 3 sets with the following function:
library(VennDiagram)
draw.triple.venn(10,5,4,2,3,1,1,ind=TRUE,scaled=TRUE).
In the Quartz window I receive 3 identical circles (all of the same size). Where did the scaling go? After several hours of trying, I am wondering if it is a bug or if maybe the previous settings of my plotting area are not allowing it ( i closed and reopened the Quartz window several times). The output value is:
(polygon[GRID.polygon.1498], polygon[GRID.polygon.1499], polygon[GRID.polygon.1500], polygon[GRID.polygon.1501], polygon[GRID.polygon.1502], polygon[GRID.polygon.1503], text[GRID.text.1504], text[GRID.text.1505], text[GRID.text.1506], text[GRID.text.1507], text[GRID.text.1508], text[GRID.text.1509], text[GRID.text.1510], text[GRID.text.1511], text[GRID.text.1512])
Any help or tip would be appreciated. All the examples I see online are depicted already scaled.
According to the manual, scaling only happens for some configurations. One example would be
draw.triple.venn(1,2,3,0,0,0,0)
On the other hand, looking at the source code of that function, there appears to be no relevant use of that parameter at all. And indeed, passing scale=FALSE to the above command still results in scaled circles.
So it looks like with the current source code, you have no control over scaling, one way or the other.
The scale parameter is being ignored in many cases.
Here is another example that is also not plotted to scale
venn.plot <- draw.triple.venn(1883,598,2151,218,221,611,95, c("AL", "RL", "R"),scale=TRUE)
I used this .jar instead:
http://www.cs.kent.ac.uk/people/staff/pjr/EulerVennCircles/EulerVennApplet.html
Related
I'm working with the ciplot graphing module for Stata and am encountering a problem with the alignment of bars when I use the by() option. Here's a trivial example demonstrating the issue:
webuse citytemp, clear
ciplot heatdd cooldd, by(region) horizontal recast(conn)
So, the graph shows means and confidence intervals for two variables across categories of the region variable. The bars for the different variables do not align horizontally, though. For each region, the point and bar for heatdd is one line above, and the point and bar for cooldd is one line below, the category label. I would like these to be on the same line, but I can't figure out how to achieve it.
I'm open to solutions that do not involve ciplot, but I have found it to be useful for the specific task I'm working on.
This is my program (in Stata terms, downloadable via ssc install ciplot) so I can speak confidently. (On Statalist, it's expected that you explain the exact provenance of user-written programs; that would be good practice here too.)
It's not a bug; it's a feature (supposedly).
The offsets are entirely deliberate, to avoid messes when two or more intervals would just overlap and occlude each other, which is entirely likely when groups or comparable variables have similar values, which in turn is common when you do this. Even in your example, intervals for heating and cooling degree-days for the South would overlap otherwise, so the graph makes the point for me.
I can see that it's not what you want, but
There is no option in ciplot to remove the offset. I can see a case for one, but
My advice is now to use statsby to get a reduced dataset containing the confidence interval information, and then the graphics are typically a couple of command lines and you get to choose what you want. This approach is documented in a paper easily accessible from the Stata Journal.
You are always welcome to clone the program and modify the code using a different program name, with notional mention of the original.
I use Jenkins and its Plot Plugin to generate statistics.
Example:
For every Build I plot the line of codes. Lets say I have like 500.000 lines and it changes about +-100 lines per build.
Since the plot y-axis always starts with 0 the whole plot is meaningless. It looks like 1 straight line.
Same goes for other metrics, if the value is too high.
Question: is there any configuration to set minimum y-axes to the minimum value?
Unfortunately, I think the answer to your question is currently 'no'.
First of all, the documentation does not give any hints towards such an option.
Secondly, Given that the Jenkins Plot Plugin uses JFreeChart for the plotting, the setting of a range for the Y-axis should be done using the 'getRangeAxis' function. A search in the source-code does not reveal a call to this function.
Lastly, you do not seem to be the only one that has this problem. Issue JENKINS-2841 asks for the same functionality, but appears not be solved yet.
I have this pairs plot
I want to make this plot bigger, but I don't know how.
I've tried
window.options(width = 800, height = 800)
But nothing changes.
Why?
That thing's huge. I would send it to a pdf.
> pdf(file = "yourPlots.pdf")
> plot(...) # your plot
> dev.off() # important!
Also, there is an answer to the window sizing issue in this post.
If your goal is to explore the pairwise relationships between your variables, you could consider using the shiny interface from the pairsD3 R package, which provides a way to interact with (potentially large) scatter plot matrices by selecting a few variables at a time.
An example with the iris data set:
install.packages("pairsD3")
require("pairsD3")
shinypairs(iris)
More reference here
I had the same problem with the pairs() function. Unfortunately, I couldn't find a direct answer to your question.
However, something that could help you is to plot a selected number of variables only. For this, you can either subset the default plot. Refer to this answer I received on a different question.
Alternatively, you can use the pairs2 function which I came across through this post.
To make the plot bigger, write it to a file. I found that a PDF file works well for this. If you use "?pdf", you will see that it comes with height and width options. For something this big, I suggest 6000 (pixels) for both the height and width. For example:
pdf("pairs.pdf", height=6000, width=6000)
pairs(my_data, cex=0.05)
dev.off()
The "cex=0.05" is to handle a second issue here: The points in the array of scatter plots are way too big. This will make them small enough to show the arrangements in the embedded scatter plots.
The labels not fitting into the diagonal boxes is resolved by the increased plot size. It could also be handled by changing the font size.
I am trying to render 739455 data point on a graph using R, but on the x-axis I can not view all those numbers, is there a way I can do that?
I am new to R.
Thank you
As others suggested, try hist, hexbin, plot(density(node)), as these are standard methods for dealing with more points than pixels. (I like to set hist with the parameter breaks = "FD" - it tends to have better breakpoints than the default setting.)
Where you may find some joy is in using the iplots package, an interactive plotting package. The corresponding commands include ihist, iplot, and more. As you have a Mac, the more recent Acinonyx package may be even more fun. You can zoom in and out quite easily. I recommend starting with the iplots package as it has more documentation and a nice site.
If you have a data frame with several variables, not just node, then being able to link the different plots such that brushing points in one plot highlights them in another will make the whole process more stimulating and efficient.
That's not to say that you should ignore hexbin and the other ideas - those are still very useful. Be sure to check out the options for hexbin, e.g. ?hexbin.
I am in my way of finishing the graphs for a paper and decided (after a discussion on stats.stackoverflow), in order to transmit as much information as possible, to create the following graph that present both in the foreground the means and in the background the raw data:
However, one problem remains and that is overplotting. For example, the marked point looks like it reflects one data point, but in fact 5 data points exists with the same value at that place.
Therefore, I would like to know if there is a way to deal with overplotting in base graph using points as the function.
It would be ideal if e.g., the respective points get darker, or thicker or,...
Manually doing it is not an option (too many graphs and points like this). Furthermore, ggplot2 is also not what I want to learn to deal with this single problem (one reason is that I tend to like dual-axes what is not supprted in ggplot2).
Update: I wrote a function which automatically creates the above graphs and avoids overplotting by adding vertical or horizontal jitter (or both): check it out!
This function is now available as raw.means.plot and raw.means.plot2 in the plotrix package (on CRAN).
Standard approach is to add some noise to the data before plotting. R has a function jitter() which does exactly that. You could use it to add the necessary noise to the coordinates in your plot. eg:
X <- rep(1:10,10)
Z <- as.factor(sample(letters[1:10],100,replace=T))
plot(jitter(as.numeric(Z),factor=0.2),X,xaxt="n")
axis(1,at=1:10,labels=levels(Z))
Besides jittering, another good approach is alpha blending which you can obtain (on the graphics devices supporing it) as the fourth color parameter. I provided an example for 'overplotting' of two histograms in this SO question.
One additional idea for the general problem of showing the number of points is using a rug plot (rug function), this places small tick marks along the margin that can show how many points contribute (still use jittering or alpha blending for ties). This allows the actual points to show their true rather than jittered values, but the rug can then indicate which parts of the plot have more values.
For the example plot direct jittering or alpha blending is probably best, but in some other cases the rug plot can be useful.
You may also use sunflowerplot, while it would be hard to implement it here. I would use alpha-blending, as Dirk suggested.