polar-coordinates

r - ggplot2: connecting points in polar coordinates with a straight line

痞子三分冷 提交于 2019-11-27 08:02:32
问题 I have a plot in polar coordinates. I used geom_path to connect the points, but I'd like the paths to be straight lines. Here's what I have so far: example <- data.frame(c(5,4,3),c(0.9,1.1,0.6)) colnames(example) <- c("r", "theta") myplot <- ggplot(example, aes(r, theta)) + geom_point(size=3.5) + coord_polar(theta="y", start = 3/2*pi, direction=-1) + scale_x_continuous(breaks=seq(0,max(example$r)), lim=c(0, max(example$r))) + scale_y_continuous(breaks=round(seq(0, 2*pi, by=pi/4),2), expand=c

Plot a heart in R [duplicate]

谁说胖子不能爱 提交于 2019-11-26 23:52:05
问题 Possible Duplicate: Equation-driven smoothly shaded concentric shapes How could I plot a symmetrical heart in R like I plot a circle (using plotrix) or a rectangle? I'd like code for this so that I could actually do it for my self and to be able to generalize this to similar future needs. I've seen even more elaborate plots than this so it's pretty doable, it's just that I lack the knowledge to do it. 回答1: This is an example of plotting a "parametric equation", i.e. a pairing of two separate

How to change an image from Cartesian to Polar coordinates in Matlab?

≡放荡痞女 提交于 2019-11-26 16:48:24
问题 I am trying to convert the pixels of an image from x-y coordinate to polar coordinate and I have problem with it, as I want to code the function by myself. Here is the code I did so far: function [ newImage ] = PolarCartRot % read and show the image image= imread('1.jpg'); %%imshow(image); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %change to polar coordinate [x y z]= size(image); r = sqrt(x*x+y*y); theta = atan2(y,x); for i =0:r for j= 0:theta newpixel = [i; j];

R interpolated polar contour plot

谁说我不能喝 提交于 2019-11-26 12:09:17
问题 I\'m attempting to script a contour polar plot in R from interpolated point data. In other words, I have data in polar coordinates with a magnitude value I would like to plot and show interpolated values. I\'d like to mass produce plots similar to the following (produced in OriginPro): My closest attempt in R to this point is basically: ### Convert polar -> cart # ToDo # ### Dummy data x = rnorm(20) y = rnorm(20) z = rnorm(20) ### Interpolate library(akima) tmp = interp(x,y,z) ### Plot