plotrix


Put a break in the Y-Axis of a histogram

倾然丶 夕夏残阳落幕 提交于 2020-01-08 21:42:40
问题 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 the gap.plot() function from the plotrix package, but I've only seen examples of doing that with scatter and line plots. I've been able to add a break in the box around my plot and put a zigzag in there, but I can't figure out how to rescale my axes

Put a break in the Y-Axis of a histogram

落花浮王杯 提交于 2020-01-08 21:40:56
问题 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 the gap.plot() function from the plotrix package, but I've only seen examples of doing that with scatter and line plots. I've been able to add a break in the box around my plot and put a zigzag in there, but I can't figure out how to rescale my axes

plot time series with discontinuous axis in R

喜你入骨 提交于 2020-01-02 14:59:08
问题 I want to plot a time series, excluding in the plot a stretch of time in the middle. If I plot the series alone, with only an index on the x-axis, that is what I get. The interior set of excluded points do not appear. x <- rnorm(50) Dates <- seq(as.Date("2008-1-1"), by = "day", length.out = length(x)) dummy <- c(rep(1, 25), rep(0, 10), rep(1, length(x) - 35)) plot(x[dummy == 1]) Once the dates are on the x-axis, however, R dutifully presents an accurate true time scale, including the excluded

Control over axis in twoord

五迷三道 提交于 2019-12-25 01:53:39
问题 G'day I have plotted a combination bar and line graph using twoord, with finical years as the x axis. Please see example a=c(50,75,80,100,110) b=c(500,750,800,1000,1100) finyr=c("2001-02","2002-01","2003-04","2004-05","2005-06") twoord.plot(finyr,a,finyr,b, type=c("bar","l"), ylab="a",rylab="b",xlab="Financial year", lcol=32,rcol=4,do.first="plot_bg()") Because financial year is a character, it returns the following error message Error in plot.window(...) : invalid 'xlim' value In addition:

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

牧云@^-^@ 提交于 2019-12-20 01:43:16
问题 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 without a gap, but my supervisor wants to have one. I tried axis.break() of the plotrix library, but nothing happened. I tried to rebuild the graphic with gap.plot but I was not successful, but I must admit that I'm no R-hero. Here's the code for my

Drawing circles in R

喜欢而已 提交于 2019-12-18 07:07:49
问题 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 center. So the circle in the plot should go through these points, right? And I don't know why the circle looks wrong. Is there an explanation? p1 <- c(1,1) p2 <- c(4,1) p3 <- c(1,4) r <- sqrt(sum((p1-p2)^2)) plot(x=c(p1[1], p2[1], p3[1]), y=c(p1[2

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

被刻印的时光 ゝ 提交于 2019-12-12 08:53:57
问题 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 (the other options is pa = 0) and another inner arc (outside of the first arc) corresponding to sampled = 1 (other option is sampled = 0). Data looks like this: m season pa month sampled occupancy 1 spring 1 3 1 present 2 spring 1 4 1 present 3

Rescale axis in grouped scatter plots with use of axes breaks

雨燕双飞 提交于 2019-12-11 04:58:21
问题 The data for some of these types graphs that I'm graphing in R, http://graphpad.com/faq/images/1352-1(1).gif has outliers that are way out of range and I can't just exclude them. I attempted to use the axis.break() function from plotrix but the function doesn't rescale the y axis. It just places a break mark on the axis. The purpose of doing this is to be able to show the medians for both groups, as well as the data points, and the outliers all in one plot frame. Essentially, the data points

Handling axis with dates in twoord.plot (remove axis 3)

六月ゝ 毕业季﹏ 提交于 2019-12-10 11:06:03
问题 I am trying to use twoord.plot with different dates on x axis and counts for ly and percentages for ry , and I want to remove axis 3 or change its color. Setting axes = F does not work, neither does xaxt = 'n' . In fact, axes = FALSE gives me this error message: Error in plot.default(lx, ly, xlim = xlim, ylim = lylim, xlab = xlab, : formal argument "axes" matched by multiple actual arguments The solution given here: Remove all axis values and labels in twoord plot does not work for me with

Remove all axis values and labels in twoord plot

社会主义新天地 提交于 2019-12-10 10:38:35
问题 I want to remove all the axis including x, left and right y but retain the boundary of the plot. I tried to set xaxt and yaxt to 'n' but no luck. library(plotrix) twoord.plot(2:10,seq(3,7,by=0.5)+rnorm(9), 1:15,rev(60:74)+rnorm(15), type=c("bar","l"), xaxt='n', yaxt='n') Is there any suggestion? Thanks in advance. 回答1: I don't think so from what I saw. It's easy enough to create this plot anyway: library('plotrix') set.seed(1) x1 <- 2:10 y1 <- seq(3,7,by=0.5)+rnorm(9) x2 <- 1:15 y2 <- rev(60

工具导航Map