Visualization using ggplot2 (draw curves) with a big dataset - r

I want to use ggplot2 to draw curves (geom_curve with ggplot2 2.0.0), but the number of curves is too large (about 2 million curves). I want to draw them in one figure, but it will take too long.
I want to get a figure like this:
How I can draw a figure like this? ggplot2? or any other better tools?

Related

Modify `geom_violin` to plot a histogram instead of a density?

Would it be possible to extend geom_violon (and ideally geom_split_violin as in #jan-glx's answer here Split violin plot with ggplot2)?
How would I go about doing this?

Cicular contour map using Plotly

I am trying to create contour plots of film thicknesses on a wafer using plotly, but would like the outputted plot to be a circle since it is a wafer instead of the default square. Do I have to somehow overlay a circle on to the plot and then exclude anything outside of it after the plot is generated? I prefer using plotly if possible since it looks nice. I've tried using ggplot as well but for some reason my data doesn't work with it since the x and y coordinates are apparently irregularly spaced. I've searched around but have not seen any results at least using R.
Thanks!

How do you plot a 3d scatterplot with multiple facets?

I'm trying to plot a 3d scatterplot (let's use this previous question as an example), but as a grid with multiple 3D scatterplots on the same page based on a categorical factor. I see how many people can do this with, for example, boxplots, but have no idea how to do so with a 3-d scatterplot. Any thoughts would be very helpful.
You can do this with the cloud function in the lattice package, although it probably doesn't offer as much easy fine-scale control as scatterplot3d- or rgl-based plots:
set.seed(101)
d <- data.frame(x=runif(1000),y=runif(1000),z=runif(1000),
f=factor(sample(1:10,replace=TRUE,size=1000)))
library("lattice")
cloud(z~x*y|f,data=d)

Transforming table to format for stacked bar chart

I've got a data frame in R that looks like this
URL TTFB StartRender FullyLoaded
http://news.bbc.co.uk/ 500 750 3000
and I want to plot a stacked bar chart from it where each segment of the bar is as follows:
TTFB
StartRender - TTFB
FullyLoaded - StartRender
I'm having a real problem understanding how I need to transform the data to be able to plot the column for each URL (or even what the data needs to look like)
Stacked bar charts are not good data visualizations. Much better to use a grouped Cleveland dot plot. In R these are available with the dotchart command in the graphics package.
The problem with stacked bar charts is that it is hard to estimate the proportions except for the bottom of the stack.
Faceting provides a good alternative to stacking, and can be done fairly easily in R using ggplot2

R: How to overlay pie charts on 'dots' in a scatterplot in R

Using R I would like to replace the points in a 2d scatter plot by a pie chart displaying additional values.
The rational behind is that I have time series data for hundreds of elements (proteins) derived from a biological experiment monitored for 4 conditions. I would like to plot the elements (categorial data) on the y axis and occurrence of a event in time on the x axis. To visualize the relative occurrence between the 4 conditions I would like to visualize this in form of a pie chart or doughnut chart overplayed onto the respective point in the scatter plot.
The overall data density is low so overlapping won't be an issue.
Is this possible in R?
I was thinking of using a manual scale in ggplot2 but could not figure out how to define a pie chart as a scale.
Also of interest would be how to best cluster this data and sort it accordingly.
Yes. pieGlyph() is one ready-to-go function from the Rgraphviz package.
Also, I would check out this Q/A for how to do things like this more generally:
How to fill a single 'pch' point on the plot with two-colours?
Especially check out ?my.symbols from the TeachingDemos package.
Lastly, in regards to ggplot2, you should check out this blog post about possible upcoming features:
http://blog.revolutionanalytics.com/2011/10/ggplot2-for-big-data.html
See also Paul Murrell. Integrating grid graphics output with base graphics output. R News, 3(2):7-12, October 2003. http://www.r-project.org/doc/Rnews/Rnews_2003-2.pdf
The code on pp 10-11 sets up the main plot axes, labels and legend, and then opens a series of smaller windows centered at each individual point on the plot and plots a small graph in each window. I've tried pie charts, mosaics and barplots, but the method is not limited to these types.

Resources