polar-coordinates

Stereographic Sun Diagram matplotlib polar plot python

▼魔方 西西 提交于 2019-12-09 18:32:18
问题 I am trying to create a simple stereographic sun path diagram similar to these: http://wiki.naturalfrequency.com/wiki/Sun-Path_Diagram I am able to rotate a polar plot and set the scale to 90. How do I go about reversing the y-axis? Currently the axis goes from 0>90, how do I reverse the axis to 90>0 to represent the azimuth? I have tried: ax.invert_yaxis() ax.yaxis_inverted() Further, how would I go about creating a stereographic projection as opposed to a equidistant? My code: import

Move radial tick labels on a polar plot in matplotlib

无人久伴 提交于 2019-12-09 18:24:17
问题 From matplotlib examples: import numpy as np import seaborn as sbs import matplotlib.pyplot as plt r = np.arange(0, 3.0, 0.01) theta = 2 * np.pi * r ax = plt.subplot(111, polar=True) ax.plot(theta, r, color='r', linewidth=3) ax.set_rmax(2.0) ax.grid(True) ax.set_title("A line plot on a polar axis", va='bottom') plt.show() How to move the radial tick labels (0.5, 1.0, 1.5, 2.0) to a different angle, say 120 deg? 回答1: With version 1.4 or later, you can use "set_rlabel_position". e.g. to place

Converting an image from Cartesian to Polar - Limb Darkening

女生的网名这么多〃 提交于 2019-12-09 12:41:34
问题 import numpy as np import cv2 from matplotlib import pyplot as plt img = cv2.imread('C:\\Users\\not my user name\\Desktop\\20140505_124500_4096_HMIIC.jpg', 0) norm_image = cv2.normalize(img, dst=None, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_32F) plt.imshow(norm_image, cmap='afmhot', interpolation='bicubic') plt.xticks([]), plt.yticks([]) plt.show() The solar disc I'm using: I'm wondering if there is an easy way to convert the image from cartesian to polar? Like this example: Or like this

Python Uniform distribution of points on 4 dimensional sphere

一个人想着一个人 提交于 2019-12-09 05:51:05
问题 I need a uniform distribution of points on a 4 dimensional sphere. I know this is not as trivial as picking 3 angles and using polar coordinates. In 3 dimensions I use from random import random u=random() costheta = 2*u -1 #for distribution between -1 and 1 theta = acos(costheta) phi = 2*pi*random x=costheta y=sin(theta)*cos(phi) x=sin(theta)*sin(phi) This gives a uniform distribution of x, y and z. How can I obtain a similar distribution for 4 dimensions? 回答1: A standard way, though, perhaps

Why is there Gap in this Matlab Polar presentation with export_fig?

限于喜欢 提交于 2019-12-08 05:13:19
问题 Code which yields a gap at the line from origo (0,0) to (1,0), which seems to reach zero if C dimensions reaches infinity; however, I cannot get it small enough with any sizes of C so I think the artifact can be caused by Matlab figure internal features or image data itself (AnderBiguri) because it does not seem to occur for img=imread('peppers.png') . Code which makes the image, stores it by export_fig and maps it from Cartesian to Polar where the artifact occurs close all; clear all; clc; %

Resizing a polar coordinate image

一个人想着一个人 提交于 2019-12-08 05:11:29
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 using imshow) Resizing the third graph works well but I need resized version of the first polar

Polar plot gives wrong angles in matplotlib

故事扮演 提交于 2019-12-08 04:13:46
问题 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

Scaling the axes in a polar plot of ggplot individually?

筅森魡賤 提交于 2019-12-07 22:32:23
问题 my dataset is cvar setting value var1 min 20 var2 min 5 var3 min 140 var4 min 40 var5 min 600 var1 max 60 var2 max 15 var3 max 180 var4 max 80 var5 max 1200 var1 center 40 var2 center 10 var3 center 160 var4 center 60 var5 center 900 var1 upper 57 var2 upper 13 var3 upper 162 var4 upper 79 var5 upper 1250 var1 lower 20 var2 lower 6 var3 lower 153 var4 lower 40 var5 lower 620 With library(ggplot2) ggplot(data=daten, aes(x=factor(cvar), y=value, group = setting, color = setting)) + geom_line()

R: How to combine straight lines of polygon and line segments with polar coordinates?

亡梦爱人 提交于 2019-12-07 20:11:12
问题 Let's say I have linear data in 6 directions with some lengths. I want to make chart in style of "wind rose". ###create sample data a <- c(1,2,3,4,5,6) #directions perc <- c(0.15,0.05,0.3,0.15,0.05,0.3) #percentual lengths lab <- c("A", "B", "C", "D", "E", "F") #labels of directions data <- data.frame(a,perc,lab) I have tried two variants with ggplot2, using coord_polar and coord_radar (inspired by an article from Erwan Le Pennec: From Parallel Plot to Radar Plot). Each one is partly correct

Matplotlib - How to plot streamlines in polar coordinates?

China☆狼群 提交于 2019-12-07 19:07:47
问题 I have been trying to plot streamlines on a polar axis in matplotlib 1.4.3. The streamplot function has been around since 1.2.0 and is considered functional and stable by the documentation. Here is a little test script: from matplotlib import pyplot as plt import numpy as np # Define polar grid r = np.arange(0,2001,50) theta = np.arange(-np.pi, np.pi+np.pi/180, 2*np.pi/180) r2D, theta2D = np.meshgrid(r, theta) # Define some data u = -np.sin(theta2D) v = np.cos(theta2D) # Set up axes fig = plt