polar-coordinates

R: Converting cartesian coordinates to polar coordinates, and then calculating distance from origin

十年热恋 提交于 2020-12-01 10:18:17
问题 I've been looking for a solution to convert cartesian coordinates (lat, long) that I have to polar coordinates in order to facilitate a simulation that I want to run, but I haven't found any questions or answers here for doing this in R. There are a number of options, including the built in function cart2pol in Matlab, but all of my data are in R and I'd like to continue getting comfortable working in this framework. Question: I have lat/long coordinates from tagging data, and I want to

Polar plot with a 'floating' radial axis

梦想的初衷 提交于 2020-06-25 05:53:23
问题 I'm working on a figure consisting of a large number of polar plots in a grid, all of which share a common scale in the radial axis. Each plot needs to be quite small in order to fit into the figure, but when I scale down the dimensions of the axes, the tick labels for the radial axis look crowded and illegible, and obscure the data I'm trying to plot. For example: import numpy as np from matplotlib import pyplot as plt fig, axes = plt.subplots(1, 4, figsize=(9, 2), subplot_kw=dict(polar=True

Round and draw external scale in polar plot

淺唱寂寞╮ 提交于 2020-06-01 05:11:30
问题 I've found this answer to a question where an approach for a scale outside a polar plot is provided (the add_scale function there). I tried to apply this to my data as well and it almost worked out. As shown in the picture, there is an issue at the top of the scale bar. How can I remove this little too long part of the scale? Second question is: How can I round the values in this scale to two digits. I've had a look at this question, but it didn't work out. I'll re-post the code here with all

Changing axis options for Polar Plots in Matplotlib/Python

无人久伴 提交于 2020-02-02 03:20:31
问题 I have a problem changing my axis labels in Matplotlib. I want to change the radial axis options in my Polar Plot. Basically, I'm computing the distortion of a cylinder, which is nothing but how much the radius deviates from the original (perfectly circular) cylinder. Some of the distortion values are negative, while some are positive due to tensile and compressive forces. I'm looking for a way to represent this in cylindrical coordinates graphically, so I thought that a polar plot was my

Converting Cartesian image to polar, appearance differences

前提是你 提交于 2020-01-24 22:16:33
问题 I'm trying to do a polar transform on the first image below and end up with the second. However my result is the third image. I have a feeling it has to do with what location I choose as my "origin" but am unsure. radius = sqrt(width**2 + height**2) nheight = int(ceil(radius)/2) nwidth = int(ceil(radius/2)) for y in range(0, height): for x in range(0, width): t = int(atan(y/x)) r = int(sqrt(x**2+y**2)/2) color = getColor(getPixel(pic, x, y)) setColor( getPixel(radial,r,t), color) 回答1: There

Custom Spider chart --> Display curves instead of lines between point on a polar plot in matplotlib

别说谁变了你拦得住时间么 提交于 2020-01-23 06:42:49
问题 I have measured the positions of different products in different angles positions (6 values in steps of 60 deg. over a complete rotation). Instead of representing my values on a Cartesian graph where 0 and 360 are the same point, I want to use a polar graph. With matplotlib , I got a spider chart type graph, but I want to avoid straight lines between points and display and extrapolated values between those. I have a solution that is kind of OK, but I was hoping there is a nice "one liner" I

Custom Spider chart --> Display curves instead of lines between point on a polar plot in matplotlib

折月煮酒 提交于 2020-01-23 06:41:05
问题 I have measured the positions of different products in different angles positions (6 values in steps of 60 deg. over a complete rotation). Instead of representing my values on a Cartesian graph where 0 and 360 are the same point, I want to use a polar graph. With matplotlib , I got a spider chart type graph, but I want to avoid straight lines between points and display and extrapolated values between those. I have a solution that is kind of OK, but I was hoping there is a nice "one liner" I

Scatter polar plot in matlab

≯℡__Kan透↙ 提交于 2020-01-13 19:22:09
问题 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 回答1: Matlab is quite adequate for that, I think. As for the polar function,

How to integrate Java swing black background toolbar into polaraxes?

别说谁变了你拦得住时间么 提交于 2020-01-03 04:59:19
问题 Code where I try to integrate shortened version of Altman's MATLAB 2013 polar radar system code into MATLAB 2016b polarxes implementation because I want to have black background in toolbar and zoom feature with horiozontal scrollbar. The former code basically uses javax.swing.JSlider having a continuous-movement callback . The current bug comes from the line 'StateChangedCallback',{@cbSlider,fp,imax}); where axes imax does not behave as expected close all; clear all; clc; % http:/