polar-coordinates

polar image plot, how to do it with R?

旧巷老猫 提交于 2020-01-03 02:31:09
问题 I cannot find a straightforward way to make a nice image plot in R, but in polar coordinates. I'm basically attempting to find a R equivalent for the 'polarplot3d' function in MATLAB. I've been playing around with ggplot2 package but without much luck. Am I missing a package that contains functionality for what I'm attempting? thanks in advance for any pointers. Ok, I'm trying to be more clear about what I'm trying to do. Lets say I want to define a polar coordinate grid, increments in the

modified polar plot using ggplots or other alternative packages using R

一个人想着一个人 提交于 2020-01-01 00:44:12
问题 I am trying to create nice (!) polar plot with the following data. gr1 <- c(0, 5, 15, 20, 30, 40) gr3 <- c(0, 5, 10, 25, 40, 60, 80) gr2 <- c(0, 15, 25, 30, 40) df2<- data.frame (pos = c(gr1, gr2, gr3), group = c(rep(1, length(gr1)), rep(2, length(gr1)), rep(2, length(gr1)))) inner circle segment to mark first tier, group 1, between 15, 20 group 3, between 5, 10 between 40 to 60 second tier, group 1, between 15, 20 group 3, between 5, 10 between 10, 25 between 40 to 60 The angle between two

How do I use quiver in Python for polar?

烈酒焚心 提交于 2019-12-25 03:38:35
问题 Firstly, yes I have read previous threads and documentation about this issue, for example How to make a quiver plot in polar coordinates. This didn't help me all the way. Let me show you what I am working with and then some code. This is a converging canal, it shows a velocity/vector field. Clearly I only have a radial component, but it changes with the angle theta. This pattern of arrows repeats itself as we go down(stream) towards alpha. So it should be simple to plot, right. Here is the

R Plotly Polar Equation Rose Curve Graph Issue

匆匆过客 提交于 2019-12-24 19:33:10
问题 I am trying to graph polar equations in R using plotly. However, when I graph a rose curve, I'm not getting the right amount of petals in the graph. My code... library(plotly) f <- function(){ output <- matrix(ncol=2, nrow = 361) for (i in 0:360){ output[i,1] <- i output[i,2] <- 3 * cos(2 * (i * pi/180)) } return(output) } mf <- f() df <- data.frame("theta" = mf[,1], "r"=mf[,2]) p <- plot_ly( df, type = 'scatterpolar', mode = 'lines' ) %>% add_trace( r = ~r, theta = ~theta, name = 'Function',

Matlab: polar coordinates grey scale plot

▼魔方 西西 提交于 2019-12-24 18:40:19
问题 edit: I decided to split this question into two parts, because it were really two questions: 1. how to make a polar surface plot in MATLAB (this question) and 2. how to put fit polar data points into a coarse (and non-polar) matrix I have a matrix that contains certain grey values (values between zero and one). These points are stored in a rectangular matrix, but really the data points are acquired by rotating the detector. This means that I actually have polar coordinates (I know the polar

How to draw polar hist2d/hexbin in matplotlib?

烈酒焚心 提交于 2019-12-24 05:29:10
问题 I have a random vector (random length and random angle) and would like to plot its approximate PDF (probability density function) via hist2d or hexbin . Unfortunately they seems not to work with polar plots, the following code yields nothing: import numpy as np import matplotlib.pyplot as plt # Generate random data: N = 1024 r = .5 + np.random.normal(size=N, scale=.1) theta = np.pi / 2 + np.random.normal(size=N, scale=.1) # Plot: ax = plt.subplot(111, polar=True) ax.hist2d(theta, r) plt

How to gradient fill an annotation shape in ggplot2

两盒软妹~` 提交于 2019-12-24 00:59:40
问题 I have a polar plot that graphs hourly data over a year. I have managed to put in four annotation rectangles to denote season. I would like these rectangles to have a gradient fill from clear to the current colour. Here is my current graph: I have tried to put in a gradient fill for the rectangles specifically, but this conflicts with the marker scale fill gradient. Ideally the graph would look like this: Here is my code so far: #how to generate a dataset with hourly readings over a year and

Cartesian to polar coordinates

爷,独闯天下 提交于 2019-12-23 07:39:56
问题 Take a look at the example here: http://www.brianhare.com/physics/so.html Take a look at console.log where I am using these two main functions: function distanceBetween2pts(x1, y1, x2, y2) { console.log("Particle: ("+x1+","+y1+") Mouse: ("+x2+","+y2+")"); // Pythagoras Theorem // PQ = sqrt( (x2-x1)^2 + (y2-y1)^2 ) var x = (x2-x1); var y = (y2-y1); this.radius = Math.sqrt(x*x + y*y); this.x = x; this.y = y; } function polar2cartesian(R, theta) { this.x = R * Math.cos(theta); this.y= R * Math

griddata: QH6214 qhull input error: not enough points(2) to construct initial simplex

一曲冷凌霜 提交于 2019-12-23 04:39:12
问题 I am trying to create an above-head view heat map of relatively sparse EEG data (27 electrodes). I convert x,y cartesian coordinates of the EEG electrodes to polar, and attempt to map them as such. Each x,y coordinate corresponds to a given value (if you want to know: Hurst exponent) to which I would like the color around that location to correspond. I started with working code from this page and tried to adapt it to my problem. Unfortunately, my adaptation is not working. Here is my code:

Resizing a polar coordinate image

大兔子大兔子 提交于 2019-12-23 03:49:05
问题 I have an image from weather radar which is in polar coordinates (azimuth, range). Normal resizing functions are not working as they presume the image in Cartesian coordinate I guess. From scikit-image etc. How can I resize the image effectively having same ratio and characteristics maintained as we get in Cartesian. Or the only way is to convert to Cartesian and then back ? Original (masked array) displayed using weather lib: Polar Cordinates Contour based: resized the array (and plotted