Questions tagged [ggforce]

Accelerating ggplot2

ggforce is a package aimed at providing missing functionality to through the extension system introduced with ggplot2 v2.0.0. Broadly speaking ggplot2 has been aimed primarily at explorative data visualization in order to investigate the data at hand, and less at providing utilities for composing custom plots a la D3.js. ggforce is mainly an attempt to address these "shortcoming"(design choices might be a better description). The goal is to provide a repository of geoms, stats, etc. that are as well documented and implemented as the official ones found in ggplot2.

125 questions
23
votes
1 answer

Animated plot with a moving facet zoom via gganimate and ggforce?

Goal I would like to zoom in on the GDP of Europe throughout the years. The phantastic ggforce::facet_zoom allows this for static plots (i.e., for one specific year) very easily. Moving scales, however, prove harder than expected. gganimate seems…
Roman
  • 4,744
  • 2
  • 16
  • 58
12
votes
2 answers

How to save output from ggforce::facet_grid_paginate in only one pdf?

I'm using the ggforce package to generate facetted plots over several pages: library(ggforce) for(i in 1:6){ ggplot(diamonds) + geom_point(aes(carat, price), alpha = 0.1) + facet_wrap_paginate(~cut:clarity, ncol = 2, nrow = 2, page =…
Dan
  • 1,711
  • 2
  • 24
  • 39
10
votes
1 answer

ggplot2 add annotation spanning facet edges

I want to draw a rectangular annotation that will span over the facet borders in ggplot. library(ggplot2) myPlot <- ggplot(mpg, aes(displ, hwy)) + geom_point() + facet_grid(class ~ .) # add annotation myPlot + annotate("rect", xmin = 3,…
user131291
  • 147
  • 6
10
votes
2 answers

how to draw two half circles in ggplot in r

How can I make a plot like this with two different-sized half circles (or other shapes such as triangles etc.)? I've looked into a few options: Another post suggested using some unicode symbol, that didn't work for me. And if I use a vector image,…
santoku
  • 3,297
  • 7
  • 48
  • 76
9
votes
1 answer

Facet wrap plots with nested `ggforce::facet_zoom`

I'd like to make a plot with ggplot2::facet_wrap or facet_grid with nested plots that use ggforce::facet_zoom. I'd also be happy enough lining them up in a similar fashion to facet_grid, preferably with the strip text labels, though also can't quite…
Scransom
  • 3,175
  • 3
  • 31
  • 51
9
votes
1 answer

How to change the position of the zoomed area from facet_zoom()?

With facet_zoom() from the ggforce package one can create nice zooms to highlight certain regions of a plot. Unfortunately, when zooming in on the y axis the original plot is always on the right side. Is there a way to place the original plot on…
Mojoesque
  • 1,166
  • 8
  • 15
9
votes
2 answers

Order y-axis on ggforce::geom_parallel_sets

Using the dev version of the ggforce package, I can create a Sankey diagram as follows (from the documentation) data <- reshape2::melt(Titanic) data <- gather_set_data(data, 1:4) ggplot(data, aes(x, id = id, split = y, value = value)) + …
Daniel Anderson
  • 2,394
  • 13
  • 26
7
votes
1 answer

How to automate plotting 3 different regular polygons recursively?

I want to plot 3 regular polygons - squares (4 sides), hexagons (6 sides) and dodecagons (12 sides) in a way that it produces a similar plot to the following figure: So far, I have been hardcoding with the ggforce package to achieve my…
bird
  • 2,938
  • 1
  • 6
  • 27
7
votes
1 answer

facet_zoom with multiple zoom ranges

I am trying to zoom into multiple sections within a plot. I know that with facet_zoom I can zoom into a section of the plot. For example: ggplot(iris, aes(Petal.Length, Petal.Width, colour = Species)) + geom_point() + facet_zoom(x = Species ==…
user572549
  • 71
  • 4
5
votes
1 answer

ploting an ellipse in log plot with ggplot

I discovered few weeks ago ggforce, which has a great features to plot ellipse. But I don't manage to use it in log plots. Here is an example: I would like to use the ellipse to circle this group library(ggforce) library(ggplot2) ggplot(mtcars)+ …
denis
  • 5,580
  • 1
  • 13
  • 40
5
votes
1 answer

Displaying multiple factors with Sina plots

NOTE: I have updated this post following discussion with Z. Lin. Originally, I had simplified my problem to a two factor design (see section "Original question"). However, my actual data consists of four factors, requiring facet_grid. I am therefore…
Tiberius
  • 331
  • 1
  • 9
4
votes
1 answer

colour/fill Delaunay plot similar to this voronoi plot in R

using the iris dataset as an example, I am trying to create plots for Voronoi and Delaunay partitions. I can do this just fine for Voronoi PLots using ggplot and ggforce packages #voronoi plot with filled polygons ggplot(iris, aes(Sepal.Length,…
Myriad
  • 341
  • 1
  • 8
4
votes
0 answers

ggforce facet_wrap_paginate with number of plots not matching nrow and ncol

I have a problem with the facet_wrap_paginate function: I have several groups of diagrams. The number of diagrams in each group varies. When I use facet_wrap_paginate to plot each group in 5x4 diagrams onto one single pdf, I get an error if the last…
papan
  • 41
  • 2
4
votes
0 answers

Curly brace / bracket annotation on ggplot?

Is there any native way of placing a curly brace annotation on a ggplot? Example:
stevec
  • 41,291
  • 27
  • 223
  • 311
4
votes
1 answer

R install.packages polyclip: where is config.log? No answer in prior posts

Attempting to install R package ggforce encountered following error installing dependency polyclip which referred me to config.log. However, config.log is not found below ~/, /tmp, or /var/log I checked this via find . | grep config[.]log Tried…
Steve Dutky
  • 185
  • 11
1
2 3
8 9