polar-coordinates

JavaScript atan2() function not giving expected results

人走茶凉 提交于 2019-12-14 03:45:20
问题 Normally, polar coordinates go from 0 to π to 2 π (just before 2 π really, as it equals 0 again). However, when using the JavaScript atan2() function, I'm getting a different, weird range: Cartesian X | Cartesian Y | Theta (θ) =========================================================== 1 | 0 | 0 (0 × π ) 1 | 1 | 0.7853981633974483 (0.25 × π ) 0 | 1 | 1.5707963267948966 (0.5 × π ) -1 | 1 | 2.356194490192345 (0.75 × π ) -1 | 0 | 3.141592653589793 (1 × π ) -1 | -1 | -2.356194490192345 (-0.75 × π

matplotlib polar plot set_ylabel on the left hand side

随声附和 提交于 2019-12-13 01:23:34
问题 I want to write the ylabel on the left hand side in polar plot as that in the non-polar plot. Here is my code: import matplotlib.pyplot axes=matplotlib.pyplot.figure().add_subplot(1,1,1,polar=True,frameon=False) import numpy x=numpy.linspace(0,12*numpy.pi,2000) axes.plot(x,numpy.exp(numpy.cos(x))-2*numpy.cos(4*x)+numpy.sin(x/12)**5,color="black") axes.set_xlabel("y") axes.set_ylabel("$P_y$") axes.set_xticklabels([]) axes.set_yticklabels([]) axes.grid(False) import matplotlib.backends.backend

Convert image in polar to cartesian coordinates

a 夏天 提交于 2019-12-12 03:55:43
问题 I am trying to convert an image in polar to cartesian coordinates. examples to convert image to polar coordinates do it explicitly - want a slick matrix method I thought using the method used above would be a piece of cake but it really isn't!! If anyone finds an error into my code please let me know! phi=(0:.01:1)*2*pi; r=0:.01:2; psi=r<0.5; psi_c=cos(phi).'*psi; [P R z]=find(psi_c); L=500; X=R.*cos(P); Y=R.*sin(P); Xmin=min(X);Xmax=max(X); Ymin=min(Y);Ymax=max(Y); F=TriScatteredInterp(X,Y,z

What plotting software to use: 2D polar plot with unique data

冷暖自知 提交于 2019-12-11 11:54:00
问题 I have my (example) data in the following format: R_min R_max θ_min θ_min Zones 0 260 0 1.57 114 260 270 0 1.57 106 270 320 0 1.57 107 As you can see, I have "zones" (areas) that are created from R_min to R_max that sweep from theta_min to theta_max. Each row of data represents an area that I want to plot with a corresponding color based on the zone number. In this simple case, the data I show above would look like the following picture: What plotting software should I use to accomplish this?

Change axis of plotly polar plot

不问归期 提交于 2019-12-11 10:37:23
问题 I am playing with Plotly tools using python and I have made a polar plot as seen below using some dummy data: I would like to alter the axis so that the data I have (goes from around 20 to 50) is mapped to the entire 360° of the plot. Is there a way of doing this using a readymade command or do I need to write a function where you set the limits then map those numbers to degrees before changing axis labels. I have been looking through stack exchange but I can only find ways of changing it to

2D plot in 3D polar graph

僤鯓⒐⒋嵵緔 提交于 2019-12-11 06:29:49
问题 I would like to plot a 3D graph, y=100-x^2, cycle around the Y axis in 360 degrees. Eventually to become like a cone. Is that possible? I have an array x=1:1:100 , and an array y , size(1 100). I tried an Z array, z=1:1:100 as the 3th axis in the base of the cone. With plot3 I done the one graph of y=100-x^2. I would like to kinda animate it and have eventually a cone, or a surface cone. 回答1: Is this what you are looking for? r = 1:1:100; y = 100-r.^2; theta = 0:pi/20:2*pi; xx = bsxfun(@times

plot polar grey values in matrix without interpolating every for loop

此生再无相见时 提交于 2019-12-10 16:43:57
问题 I have a matrix with grey values between 0 and 1 . For every entry in the matrix, there are certain polar coordinates that indicate the position of the grey values. I already have either Theta and Rho values (polar) ,both in separate 512×960 matrices. And grayscale values (in a matrix called C ) for every Theta and Rho combination. I have the same for X and Y , as I just use pol2cart for the transformation. The problem is that I cannot directly plot these values, as they do not yet fit in the

Join gap in polar line ggplot plot

↘锁芯ラ 提交于 2019-12-10 14:55:34
问题 When ggplot makes a line plot with polar coordinates, it leaves a gap between the highest and lowest x-values ( Dec and Jan below) instead of wrapping around into a spiral. How can I continue the line and close that gap? In particular, I want to use months as my x-axis, but plot multiple years of data in one looping line. Reprex: library(ggplot2) # three years of monthly data df <- expand.grid(month = month.abb, year = 2014:2016) df$value <- seq_along(df$year) head(df) ## month year value ##

How to plot error bars in polar coordinates in python?

北慕城南 提交于 2019-12-10 14:07:42
问题 I have the following problem: I want to plot some data points in polar coordinates in python, which is easy, using some code like import numpy as np import matplotlib.pyplot as plt r = 1e04 * np.array([5.31,5.29,5.25,5.19,5.09,4.92,4.67,4.27,3.75,3.56]) theta = 2*np.pi/360 * np.array(list(range(0, 100, 10))) plt.polar(theta, r, "ro") plt.show() but I want to add error bars and I don't find any sufficient solution. Is there already some prebuild matplotlib-code? Or does anyone know how to

How to clip polar plot in pylab/pyplot

对着背影说爱祢 提交于 2019-12-10 03:41:49
问题 I have a polar plot where theta varies from 0 to pi/2, so the whole plot lies in the first quater, like this: %pylab inline X=linspace(0,pi/2) polar(X,cos(6*X)**2) (source: schurov.com) Is it possible by means of pyplot or matplotlib to clip the polar plot so that only first quater is shown (and therefore no space is wasted)? I want a picture like this (but properly scaled): (source: schurov.com) I'd like to do it by means of pyplot because I have several images like this and want to arrange