Displaying 20 results from an estimated 8000 matches similar to: "How to generate scatterplot - with a twist"
2004 Mar 19
5
asp=1 and aspect ratio
Hi everyone
I want a square scatterplot with abline(0,1) going exactly through the
SW and NE corners. By "square" I mean that the plotting region is
exactly square, and that the axis limits are identical.
x <- 1:20
y <- x+rep(c(-1,1),10)
lims <- range(c(x,y))
None of the following do this:
plot(x,y) ; abline(0,1) #not square
plot(x,y,asp=1);abline(0,1) #diagonal
2010 Nov 21
1
"negative alpha" or custom gradient colors of data dots in scatterplot ?
I know that by setting alpha to for example col = rgb(0, 0, 0, 0.1) it is
possible to see how many overlapping is in the plot. But disadvantage of it
is that single points are barely visible on the background. So I wonder if
there is possible to make setting that single points would be almost black,
but with more and more data on the same spot it would get more and more
whiteish. Or maybe it is
2002 Nov 19
1
Another plot question
Here is another, perhaps trivial, plotting question.
I am making a filled contour plot and have almost everything dialed in
the way I want it. The last hurdle (that I can foresee) is adjusting the
look of the key. I'm plotting the 25%, 50%, 75%, and 95% quantiles and I
want the key to be evenly spaced, e.g., the width of the 25% and the 95%
should look the same on the key. They are labeled
2007 Dec 14
3
Plot question
I have some data consisting of multiple trials of an experiment with
different values of an independent variable. If I run
R> plot(var,result)
I get a scatterplot of result versus the independent variable var.
If I run
R> plot(as.factor(var),result)
I get a boxplot of the distribution of result for each value of var. In
this plot, each boxplot is labeled by the corresponding value of
2003 Jan 03
4
number plot symbol in scatterplot?
If I make a scatterplot and several (e.g. 5) points lie on top of each other
at a given x,y location I would like the plot symbol to be the number of
superimposed points (e.g. "5"). Could someone please tell me how to do this
in R? Thanks!
Bill Simpson
2004 Dec 02
1
Gap between axis and bars in barplot()
Hi
Windows XP, R 2.0.1.
I am drawing a very large barplot using jpeg() - setting the width to
10,000 as there are over 5000 bars.
This all works fine and I get exactly what I want - except there is a
huge bit of white space between the Y-axis and the first bar - so much
in fact that I have to scroll two screens from the Y-axis before I see
the first bar. After that the bars are evenly spaced
2007 Oct 18
5
Secondary Y axis title
I have the following R code to create a plot with two y axes. I am
essentially trying to
plot a price series with a volume series on the same graph. (i.e. to
compare price with volume). I can label the first
y axis successfully, but the problem is in labeling the 2nd y-axis.
Essentially, the
label never appears. It seems as though there is not enough margin
on the right hand
side of
2004 Dec 09
4
Scatterplot question
Dear list members,
I have a probably simple question concerning scatterplots: I want to
draw a plot with one X but several Y columns, so that every group
of samples gets a different symbol. My table looks like this:
X Y1 Y2 Y3
1 1
2 3
3 5
4 7
5 9
6 11
7 13
8 15
Simple in Excel or StarOffice, but how do I do it in R?
Thanks a lot
Judith
2012 Jul 23
3
3D scatterplot, using size of symbols for the fourth variable
Dear R fans,
I would like to create a scatterplot showing the relationship between 4
continuous variables. I thought of using the package "scatterplot 3d" to
have a 3-dimensional plot and then using the size of the symbols to
represent the 4th variable.
Does anybody know how to do this?
I already tried to create this graph using the colour of the symbols, but I
was unable to generate
2010 Apr 25
1
categorical variable in scatterplot (car)
Hello R folks,
I am encountering a problem with the following scatterplot function from the
car package:
> scatterplot(y~x|z)
where y and x are continuous (interval) random variables and z is a
categorical variable. When z is a categorical variable coded 1 or 2, I
(appropriately) get a scatterplot of y by x, coded by z. Similarly, when z
is a categorical variable coded 1, 2, or 3, there is
2011 Jan 14
1
Question about scatterplot in package car
I am getting an error message from scatterplot:
> library(car)
> scatterplot(Prestige$income~Prestige$type)
Error in Summary.factor(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, :
range not meaningful for factors
In addition: Warning message:
In Ops.factor(x[floor(d)], x[ceiling(d)]) : + not meaningful for factors
>
The command does output the kind of graph that I want (boxplots).
2012 May 19
3
Q - scatterplot, plot function & trellis linear regressions???
Hi R-listers,
Q1) What is the difference between the scatterplot and plot function?
Q2) I am able to make a graph with the scatterplot function:
scatterplot(DevelopIndex ~ Veg,
+ data = Turtle,
+ xlab = "Vegetation border (m)",
+ ylab = "Embryonic development index")
And have been successful. But I do not know if the lines are for:
2008 Feb 11
1
scatterplot in CAR
I am trying to use scatterplot function in CAR like the following:
scatterplot(X~Y)
I want to label X points and Y ponits using the different color.
Any idea for this?
Aimin
2011 Jul 28
3
smooth scatterplot and geo map
Hello everybody,
I'm trying to understand how to draw a smoothed scatterplot on a geographic
map with R.
Have a dataframe with point locations (long, lat) and was able to simply
plot these points on a shp map by using the maptools package. However,
instead of having simply the raw points on the map, I would like to have a
"smoothed" scatterplot of the same superimposed on the map.
2009 May 01
1
Plotting extra lines on scatterplot
Hello Everyone-
I'm in the process of slowly learning R and am having a little bit of
trouble plotting an extra line onto a scatterplot. I'm sure the answer
is quite simple but I am stumped.
The code I am using is:
headways <- read.table("headways.csv", header=TRUE, sep=",",
na.strings="", dec=".", strip.white=TRUE)
plot.new()
2004 Dec 23
3
combination of scatterplot and image graph
Dear R users,
I'm interested in a combination of a scatterplot and an image graph.
I have two large vectors. Because in the scatterplot some areas are
sparsely and others densely populated, I want to see the points, and
I also want their color to be changed based on their density (similar
to a heat map). Is there a function that can do that?
Thank you,
b.
2012 Aug 11
1
using eval to handle column names in function calling scatterplot graph function
I am running R version 2.15.1 in Windows XP
I am having problems with a function I'm trying to create to:
1. subset a data.frame based on function arguments (colname & parmname)
2. rename the PARMVALUE column in the data.frame based on function
argument (xvar)
3. generate charts
plotvar <- function(parentdf,colname, parmname,xvar,yvar ){
subdf <-
2010 Nov 16
5
scatterplot with filled circles
for a simple scatterplot:
plot(X ~ Y, type = 'p', col = 'red')
this produces red-edged circles, but I want to fill in the circles.
can this be done? I checked '? plot' already but couldn't find what I was
looking for.
cheers
--
View this message in context: http://r.789695.n4.nabble.com/scatterplot-with-filled-circles-tp3044690p3044690.html
Sent from the R
2009 Jun 09
1
scatterplot (car) legend modification
hi,
new to R and using the car package to do some scatterplots with ellipses
hoping to add the area and center points of each ellipse to the legend?
looking for some direction / ideas.... here is the script, the data is
where
golf shots end up by club.
x (dispersion), y (distance), group (Club)
thanks, sam
## usage: Rscript shotScatter.R infile outfile level1 level2 minX maxX
minY maxY
2011 Feb 08
1
How to change labels in scatterplot?
Dear all,
I'm trying to use "scatterplot" from package "car" to get a scatterplot with
row-names as labels and I want my data to be divided into two groups defined
by the column "tresh". Leaving away the groups-command gives me the right
labels but they are not distinguished by colors according to "tresh". Does
anybody know why the following example