Questions tagged [plotrix]

Plotrix is a plotting library for the R programming language.

140 questions
18
votes
2 answers

Break X Axis in R

I want to get a broken X-axis in my plot. In the x-axis I like to insert a broken-axis symbol < // > [starting from 2 and ended in end 8 which means 2-8 will be hidden in < // > symbol] so the other values can be emphasized. In Matlab, this task is…
S Das
  • 3,291
  • 6
  • 26
  • 41
13
votes
2 answers

Put a break in the Y-Axis of a histogram

I'm not sure exactly what to call this, but I'm trying to achieve a sort of "broken histogram" or "axis gap" effect: http://gnuplot-tricks.blogspot.com/2009/11/broken-histograms.html (example is in gnuplot) with R. It looks like I should be using…
Kyle Oliveira
  • 131
  • 1
  • 1
  • 4
10
votes
1 answer

R - Taylor Diagram Plotting

I am trying to plot multiple models in a Taylor Diagram and am struggling slightly with the code. I have managed to produce the diagram (see image) but cannot figure out how to reduce the axes as they are too large, standardise the axes to be…
Darren J
  • 503
  • 2
  • 5
  • 16
6
votes
2 answers

How to create a circular plot showing monthly presence or absence using radial.plot / ggplot2

I want to create a figure (similar looking to the attached) in ggplot2 that is circular with month of year represented on axis so twelve tick marks around the circumference, with one inner arc of a certain color corresponding to months where pa = 1…
user5063841
6
votes
1 answer

ggplot2 polar plot arrows

I can use ggplot2 easily to draw a graph like below: In fact, for my data, it is like below: degree value 1 120 0.50 2 30 0.20 3 -120 0.20 4 60 0.50 5 150 0.40 6 -90 0.14 7 -60 0.50 8 0 0.60 The first column is the degree…
boyang
  • 377
  • 1
  • 4
  • 8
5
votes
1 answer

Outliers are missing when using plotrix boxplot() in R

Instead of R's own boxplot() the outliers are missing when using gap.boxplot() from the plotrix package. I try to understand why. See this example please: > mtcars[2,c('mpg')] <- 45 > mtcars[6,c('mpg')] <- 77 Using boxplot(mtcars$mpg) you can see…
buhtz
  • 10,774
  • 18
  • 76
  • 149
5
votes
1 answer

Drawing circles in R

I'm using plotrix package to draw circles. And I don't get what is wrong with my code... :-( I have three points. The first point (1,1) should be the center of the circle. The following two points (1,4) and (4,1) have the same distance/radius to the…
Drey
  • 3,314
  • 2
  • 21
  • 26
4
votes
2 answers

Creating a histogram with multiple data series using multhist in R

I want to create a histogram with multiple data series on the same plot. The best method that I can find to do this is multhist(). I would like a plot in a style similar to hist(), and while ggplot() can also be used to perform this task, the…
Emily
  • 859
  • 5
  • 14
  • 31
4
votes
3 answers

How to draw a circle in a log-log plot in R?

I have a plot with two logarithmic axes. I'd like to add a circle to a certain position of the plot. I tried to use plotrix, but this does not give options for "log-radius". # data to plot x = 10^(-1 * c(5:0)) y = x…
R_User
  • 10,682
  • 25
  • 79
  • 120
3
votes
1 answer

Deleting text in a plot

I'm using the plotting function sizetree from library(plotrix) (Version: 3.8-1). This function has a showcount argument that allows some counts in parenthesis to show on the plot (see pic below). But I wonder why when I use showcount=FALSE, the…
rnorouzian
  • 7,397
  • 5
  • 27
  • 72
3
votes
1 answer

axis.break and ggplot2 or gap.plot? plot may be too complex

I created a plot with ggplot2. It's about milk protein content. I have two groups and 4 treatments. I want to show the interaction between group and treatment, means and errorbars. The protein content starts at 2.6%. Now my y-axis starts there…
Z.Kipp
  • 63
  • 2
  • 9
3
votes
1 answer

Bars not anchored at zero using gap.barplot

I am using the gap.barplot() function from plotrix, and I've been having a problem when some values are very small. Starting with the following dataframe: test.df <- data.frame( perc =…
user1399932
  • 195
  • 1
  • 5
3
votes
1 answer

Combined ggplot and plotrix

I need to add a Y axis break to a plot I made in ggplot. Is it possible to use the gap.barplot function in plotrix in a graph in ggplot? When I try, it cancels everything I did in ggplot and plots just the gap.barplot bit. Thank you Barbara
B.Durante
  • 41
  • 3
3
votes
1 answer

How to remove the 0 in a radial pie chart from plotrix package?

I want to make a pie chart with radial.pie(). But on the left of the graph there is 0 and I would like to remove it. Code : pie2 <- list(0:3, 1:6, 2:5, 1:4, 0:7, 4:8, 2:9, 0:1, 0:4) radial.pie(pie2, labels = letters[2:10]) This code give us this…
Estelle Duval
  • 313
  • 4
  • 12
3
votes
1 answer

R: how to remove this tiny axis margin in plot

I want to get rid the small margin close to zero on X and Y value (red line on pic), and plot ONLY what is showed in red square. I tried setting par(mar = rep(0, 4) and xlim=c(0, ...), ylim=c(0, ...) but R still keeps adding this tiny margin. How to…
Art
  • 1,196
  • 5
  • 18
  • 34
1
2 3
9 10