polar-coordinates

Python polar clock-like plot with matplotlib

…衆ロ難τιáo~ 提交于 2019-12-07 19:06:05
问题 I am trying to plot data in a clock-wise fashion using matplotlib in Python in the style of this answer. I noticed weird behaviour when plotting my data; the data points had the correct y value, but would not appear at the correct x values, i.e. times. I first thought that my data was erroneous, but upon recreating my problem with the following working example I came to the conclusion that the mistake must be somewhere else. import numpy as np import matplotlib.pyplot as plt ax = plt.subplot

Plotrix R package polar.plot symbol overwrite

亡梦爱人 提交于 2019-12-07 11:56:58
问题 I'm using a polar plot to describe satellite position during a time series. The following question uses the polar.plot function from the R package plotrix. An example plot: library(plotrix) polar.plot(c(0,1,3,4),c(30,60,90,120),start=90,clockwise=TRUE,rp.type="s", point.symbols=19,radial.lim=c(0,5),boxed.radial=F) The issues I'm running across is that this function plots the labels and axis over the data values (see radial positions 0 and 3), and I don't see a way to control this behavior. I

matplotlib combine polar and cartesian gridded data

假装没事ソ 提交于 2019-12-07 06:11:06
问题 How do I combine gridded polar and Cartesian data on a plot? It is important to note that axes origins and scales have to match. In my application, I want to combine weather radar data ( polar ) with elevation data (Cartesian). This is the starting point : 回答1: Thinking about this for a while, the answer is you need to translate you radial data into Cartesian space: import copy # fake....err, simulated... data # elevation X, Y = np.meshgrid(np.linspace(-50, 50, 1024), np.linspace(-50, 50,

Python: Add a Ring Sector or a Wedge to a Polar Plot

南笙酒味 提交于 2019-12-07 04:59:06
问题 I have a polar plot with a specific section that I would like to colour completely in red (it is the section marked between the two red lines. Is there a function that will color that section? Or is it possible to get a solid ring sector using the Patch Collection? Here is my script: from pylab import * import matplotlib.pyplot as plt import numpy as np import pylab from matplotlib.projections import PolarAxes ############################################################################### ###

convert an image from Cartesian to Polar

旧巷老猫 提交于 2019-12-07 01:54:11
问题 I'm trying to convert an image with many circles with the same center, from Cartesian to Polar (so that the new image will be the circles but lines instead of the circles, see the image below), and that's working out just fine using the following code: [r, c] = size(img); r=floor(r/2); c=floor(c/2); [X, Y] = meshgrid(-c:c-1,-r:r-1); [theta, rho] = cart2pol(X, Y); subplot(221), imshow(img), axis on; hold on; subplot(221), plot(xCenter,yCenter, 'r+'); subplot(222), warp(theta, rho, zeros(size

Polar plot gives wrong angles in matplotlib

╄→гoц情女王★ 提交于 2019-12-06 14:50:44
I am trying to plot a Right Ascension - Declination, polar plot in Python, where the angle denotes the right ascension, and the radius the declination, ranging between ±30. My code is import numpy import matplotlib.pyplot as pyplot ra = [345.389547454166689,31.892236646759279,45.893722479722229,93.955296573703706,160.079453957685217,211.154701609814822,256.486559377222193,307.258751710462889,299.691923545370344,340.364168244814834,335.077343971296386,358.126565808425880] dec = [23.835021447037050,25.218513920000003,27.509148433518519,26.551432991388879,-25.077519630833340,-20.134061982500004,

Fix interpolated polar contour plot function to works with current R and (possibly) use ggplot

梦想的初衷 提交于 2019-12-06 12:29:45
问题 The question R interpolated polar contour plot shows an excellent way to produce interpolated polar plots in R. I include the very slightly modified version I'm using: PolarImageInterpolate <- function( ### Plotting data (in cartesian) - will be converted to polar space. x, y, z, ### Plot component flags contours=TRUE, # Add contours to the plotted surface legend=TRUE, # Plot a surface data legend? axes=TRUE, # Plot axes? points=TRUE, # Plot individual data points extrapolate=FALSE, # Should

Scatter polar plot in matlab

喜欢而已 提交于 2019-12-06 10:22:48
I'm trying to do a wedge plot (right ascension vs redshift). I was thinking I could use a scatter plot in polar coordinates. The polar function in matlab seems very limited. Even this polar(a(:,1),a(:,2),'Linewidth',1) gives me an error: Error using polar (line 23) Too many input arguments. Is there a simple way to achieve what I want using Matlab? Do you know of another software that would do it easily? Thanks, Mike Matlab is quite adequate for that, I think. As for the polar function, it seems it doesn't allow properties (such as 'linewidth' ) to be specified directly. But you can get a

Double integral in cartesian coordinate instead of (R,Theta)

隐身守侯 提交于 2019-12-06 04:07:30
问题 my previous question (Integral of Intensity function in python) you can see the diffraction model in image below: I want to calculate integral of intensity in each pixel (square), so I can't use R and Theta as variable. How can I do this in X-Y coordinate. Our function: instead of sin(theta) we can use: sintheta= (np.sqrt((x)**2 + (y)**2)/(np.sqrt((x)**2 + (y)**2 + d**2))) Other constants: lamb=550*10**(-9) k=2.0*np.pi/lamb a=5.5*2.54*10**(-2) d=2.8 when you plot function, the result is

How to use log scale on polar axis in matplotlib

强颜欢笑 提交于 2019-12-05 18:23:15
I am trying to create a polar plot with a log scale on the radial axis but I keep getting an error. Some example code and the error are below. It seems to work fine in Cartesian coordinates, does anyone know what's happening?? import matplotlib.pyplot as plt import numpy as np import matplotlib.cm as cm bazbins = np.linspace(0, 2*np.pi, 360) fbins = np.logspace(np.log10(0.05), np.log10(0.5), 101) theta, r = np.meshgrid(bazbins, fbins) # Set up plot window fig, ax = plt.subplots(figsize=(12,9))#, subplot_kw=dict(projection='polar')) # polar ax.set_theta_zero_location('N') ax.set_theta_direction