similar to: Histograms: Boxes and lines

Displaying 20 results from an estimated 5000 matches similar to: "Histograms: Boxes and lines"

2009 Jan 14
1
Histograms: Lines and boxes
Hi folks! I'm trying to get a histogram legend to give me a filled box and a line. The problem is I keep getting both filled boxes and a line. How can I get rid of the second box from the code below? x<-rnorm(1000,mean=0,sd=1) hist(x, breaks = 50, main="Histogram of x",freq=FALSE, xlab=" x", ylab="Density",col="lightblue",
2006 May 10
2
Legend titles in log plots broken? (ver. 2.2.1)
Legend titles work in linear plots: curve(1/x, xlim = c(0, 1)) legend(x = 'topright', inset = 0.04, legend = '1/x', lty = 1, title = 'Legend Title') But when you change to a log plot on either dimension things get screwy: curve(1/x, xlim = c(0, 1), log = 'y') legend(x = 'topright', inset = 0.04, legend = '1/x', lty = 1,
2012 Feb 24
1
Telling plot() the max y value to expect when plotting one distribution and then using lines() to add more distributions
I am plotting three Pearson Type IV distributions. It looks like I have to plot the distribution with the highest value of y and then use lines() to add the two distributions that are shorter / have lower max values of y. The following code figures out which distribution has the max y value, plots it first and then uses lines for the other two distributions with a series of three if statements.
2011 Mar 22
1
Problem with plot histogram
Hi R-users, I'm trying to built a plot of two series of data, but thees series result "superimposed". The R-code is like this: goal <- c(125, 143, 81, 26, 2, 3) numgoal <- 0:5 lambda <- sum(goal*numgoal)/sum(goal) plot(numgoal, goal, type="h") x <- 0:5 y<-dpois(x, lambda) att<-y*380 lines(x,att, type="h", col="red")
2007 Jun 16
1
Lines connecting the boxes in a boxplot
Hello, I'm currently using a boxplot to visualize data for three different models. As I have three models, I'm plotting three parallel boxplots for each factor. This works fine - what I need now is a line connecting the medians of each boxplot of each model. I want to do this in order to visualize the trend that one of the models exhibit. Basically, I want to plot a curve for each model
2012 Feb 16
2
Legend vanishes when placed outside the graph
Hello everyone, i’ve got a problem with my diagram’s legend. I know i should be able to figure it out by reading the ‘plot’ and ‘legend’ reference. However nothing works so it would be kind if anyone could point me to the necessary parameters. The problem is that i’m moving the legend using the ‘inset’-parameter so it does not overlap with the graph. However it vanishes outside the graph, so
2014 Mar 19
3
Leyenda gráficos
Hola, ¿hay alguna forma de colocar la leyenda de un gráfico sin que se superponga con las barras de mi gráfico? Os dejo mi ejemplo para que me entendáis: ## dado_1<-sample(1:6,1200,replace=T)dado_2<-sample(1:6,1200,replace=T)dado_3<-sample(1:6,1200,replace=T) dados<-matrix(c(table(dado_1),table(dado_2),table(dado_3)),6) barplot(t(dados),beside=TRUE,ylab="Frecuencias
2008 Jul 02
1
Multiple time series plots
Hi all: I'm trying to plot two time series created in Rmetrics and label the x-axis with dates. I tried the following: dates <- as.Date(seriesPositions(x.agg)) r <- as.Date(range(dates)) ts.plot(x.agg@Data[,c(1,5)],gpars=list(ylab="Volume", lty=c(1:2),xaxt="n",main="Plot of Volume")) axis.Date(1, at=seq(r[1], r[2], length.out=10),
2011 Nov 24
1
Legend
Hi everyone. I have a linear regression where I retrieve the R2 like this: r2 = sprintf('%4.2f %s',(summary(reg1)$r.squared)) In my figure I have a legend where I would like to add that R2 value to the legend text. Something like: My text R^2 = r2 legend('topright', inset = .05, title='light ratios', pch = c(21), c(paste('Green/Red', R^2, '=', r2)),
2008 Dec 05
1
Trouble with gridBase and inset plots
Dear All, I ma having a trouble in generating a figure containing 3 insets with the gridBase package. I always get an error message of the kind: Error in gridPLT() : Figure region too small and/or viewport too large No matter which parameters I choose. The plots works nicely with two insets only, but when I try adding the third one, my troubles begin. I am probably doing something wrong in the
2008 Mar 20
4
little subplot in corner
I want to draw a little subplot ("overview") into my detailed plot. It should be placed in say the top right corner and have the size of some legend (like legend(x="topright", inset=0.03, ...) #main plot plot(rnorm(100)) #give little density in corner plot(seq(-2,2,length=300),dnorm(seq(-2,2,length=300)),type="l") I don't want something like par(mfrow=c(1,2)) as
2011 Jun 15
1
Error bars
Hi, Can anyone help with plotting vertical error bars on a bar graph. I have tried following examples online and in the big R book and writing my own function but I have been unsuccessful and don’t really have an understanding of what it is I am doing. I have calculated my standard errors so basically just need to draw the bars on the graph but just don’t have a clue!!! I don’t even know what
2018 Apr 07
0
Fast tau-estimator line does not appear on the plot
You need to pay attention to the documentation more closely. If you don't know what something means, that is usually a signal that you need to study more... in this case about the difference between an input variable and a design (model) matrix. This is a concept from the standard linear algebra formulation for regression equations. (Note that I have never used RobPer, nor do I regularly
2013 May 27
1
Plot histograms in a loop
Hi, Try either: set.seed(28) stats1<- as.data.frame(matrix(rnorm(5*10000),ncol=5)) pdf(paste("test",1,".pdf",sep="")) par(mfrow=c(2,1)) lst1<- lapply(names(stats1),function(i) {hist(stats1[,i],100,col="lightblue",main=paste0("Histogram of ",i),xlab=i );qqnorm(stats1[,i])}) dev.off() #or
2012 Mar 25
1
Accessing more than two coefficients in a plot
I've successfully plotted (in the plot and abline code below) a simple regression of Lambda1_2 on VV1_2. I then successfully regressed Lambda1_2 on VV1_2, VV1_22 and VV1_212 producing lm2.l. When I go to plot lm2.l using abline I get the warning: "1: In abline(lm2.l, col = "brown", lty = "dotted", lwd = 2) : only using the first two of 4 regression coefficients"
2008 Dec 22
0
Align legend title
Dear R developers, I needed to align the title of legend for some of my plots. If there is interest to include this into base R, bellow are the examples and the relevent diffs. Regards, Gregor x <- 1:10 y1 <- 1.5 * x y2 <- 2.0 * x y <- cbind(y1, y2) source(file=url("http://gregor.gorjanc.googlepages.com/legend.R")) matplot(x, y, type="l", lty=c(1, 2)) ##
2018 Apr 06
1
Fast tau-estimator line does not appear on the plot
R-experts, I have fitted many different lines. The fast-tau estimator (yellow line) seems strange to me?because this yellow line is not at all in agreement with the other lines (reverse slope, I mean the yellow line has a positive slope and the other ones have negative slope). Is there something wrong in my R code ? Is it because the Y variable is 1 vector and should be a matrix ? Here is the
2009 May 06
1
Positioning a legend via X and Y coordinates
Dear R Users, I'm able to display a legend using the following code: > legend("topright", c("Simulation", "Observation"), fill=2:3, bty="n") However, this causes the legend to be positioned too close to the bars in my barplot. I'd like to move the legend up slightly. I have been trying to determine the necessary values by trial and error to do
2006 Mar 10
2
Plot.date and legends
Hi: I'm trying to plot dates on the x-axis of a code, but the legend is not being displayed. I receive the following error: Error in match.arg(x, c("bottomright", "bottom", "bottomleft", "left", : 'arg' should be one of bottomright, bottom, bottomleft, left, topleft, top, topright, right, center In addition: Warning message: longer
2009 Dec 23
1
animated R plots
 Hi, I want to be able to save the following animated plot as a flash.  There are ultimately 6 plots, but when I run this and save it as a flash all I get is the last (6th) plot, not all six different plots in order by "year".  I’ve tested the flash commands and they work; so it has to be my function code. I am guessing that the problem has something to do with overlaying the plot