polar-coordinates

How to wrap around the polar coordinate limits in ggplot2?

拟墨画扇 提交于 2019-12-22 04:20:48
问题 I have a circular space where angles 0 and 360 are equivalent. I want to plot rectangles in this space such that rectangles can cross this value. However, I am having trouble with ggplot2. base <- ggplot() + scale_x_continuous(breaks = seq(45, 360, 45), limits = c(0, 360)) + scale_y_continuous(breaks = seq(0, 1, 0.2), limits = c(0, 1)) + coord_polar(theta = "x", start = 1.5 * pi, direction = -1) 1. Attempt to plot with values exceeding xlim: base + geom_rect(aes(xmin = 340, xmax = 380, ymin =

SVG polar gradients

微笑、不失礼 提交于 2019-12-21 05:09:39
问题 I'm a beginner at SVG, but I'd like to learn some techniques. To be short, is there a simple way to create something like this? I was thinking about creating a polar gradient and then clipping it: But how do I generate a polar gradient? Even if there's no native method, maybe it could be made with a simple linear gradient and then using some rectangular-polar coordinate transformation. Is there a way to do so? 回答1: So this is the solution I developed: <?xml version="1.0" standalone="no"?> <

GPU ray casting (single pass) with 3d textures in spherical coordinates

为君一笑 提交于 2019-12-19 10:04:47
问题 i' am implementing an algorithm of volume rendering "GPU ray casting single pass". For this, i used a float array of intensity values as 3d textures ( this 3d textures describes a regular 3d grid in spherical coordinates ). Here there are example of array values: 75.839354473071637, 64.083049468866022, 65.253933716444365, 79.992431196592577, 84.411485976957096, 0.0000000000000000, 82.020319431382831, 76.808403454586994, 79.974774618246158, 0.0000000000000000, 91.127273013466336, 84

How to link correctly track points around a polar projection map?

半世苍凉 提交于 2019-12-19 03:59:27
问题 I'm trying to plot with ggplot2 the track of a bird around the antarctic. So far I have a map projected in polar coordinates, I also managed to plot the track points correctly and I almost link them correctly but ... As the track crosses the international date line (i.e. longitude 180°) ggplot2 is not able to correctly link the 2 points in either sides of the line. It does connect them but by going all the way around the earth. So I'm looking for a way to force ggplot to link the points by

Creating half a polar plot (rose diagram) with circular package

痴心易碎 提交于 2019-12-18 17:27:28
问题 I am plotting a distribution of angles with the rose.diag function from the circular library. Input data are radiants. My MWE code is library(circular); dat<-read.csv(file.choose(),header=F); data=unlist(dat); rose.diag(data, bins=24) and I get this graph: I'm interested in showing only part of the data, from -pi/2 to pi/2, and that the length of the biggest tick equals the length of the radius of the circle as show here: Any help would be appreciated! EDIT As suggested by #lawyeR here is the

Polar heatmaps in python

不羁的心 提交于 2019-12-18 16:41:52
问题 I want to plot a paraboloid f(r) = r**2 as a 2D polar heatmap. The output I expect is The code that I have written is from pylab import* from mpl_toolkits.mplot3d import Axes3D ax = Axes3D(figure()) rad=linspace(0,5,100) azm=linspace(0,2*pi,100) r,th=meshgrid(rad,azm) z=(r**2.0)/4.0 subplot(projection="polar") pcolormesh(r,th, z) show() But this program returns the following image. Can someone help? Thank you in advance. 回答1: I think you inadvertently mixed up radius , zenith and azimuth :)

Polar heatmaps in python

瘦欲@ 提交于 2019-12-18 16:41:25
问题 I want to plot a paraboloid f(r) = r**2 as a 2D polar heatmap. The output I expect is The code that I have written is from pylab import* from mpl_toolkits.mplot3d import Axes3D ax = Axes3D(figure()) rad=linspace(0,5,100) azm=linspace(0,2*pi,100) r,th=meshgrid(rad,azm) z=(r**2.0)/4.0 subplot(projection="polar") pcolormesh(r,th, z) show() But this program returns the following image. Can someone help? Thank you in advance. 回答1: I think you inadvertently mixed up radius , zenith and azimuth :)

How to use polar axes with Matlab warp?

耗尽温柔 提交于 2019-12-17 20:42:52
问题 I want to use polaraxes on the warp object on the half circumference of the polar presentation. Code without polaraxes but with warp close all; clear all; clc; % https://stackoverflow.com/a/7586650/54964 load clown; img = ind2rgb(X,map); [h,w,~] = size(img); s = min(h,w)/2; [rho,theta] = meshgrid(linspace(0,s-1,s), linspace(0,pi)); [x,y] = pol2cart(theta, rho); z = zeros(size(x)); f1=figure(); hax=axes('Parent', f1); imagesc(img, 'Parent', hax); box(hax, 'off'); axis(hax, 'off'); set(hax,

Matplotlib - Drawing a smooth circle in a polar plot

╄→尐↘猪︶ㄣ 提交于 2019-12-17 19:39:00
问题 I really like the polar plot of matplotlib and would love to keep working with it (since my data points are given in polar coordinates anyway and my environment is circular). However, in the plot, I would like to add circles of given radii at specific points. Usually, I would do: ax = plt.subplot(111) ax.scatter(data) circle = plt.Circle((0,0), 0.5) ax.add_artist(circle) plt.show() However, in polar coordinates, I cannot use circle, since it assumes rectangular coordinates. Ideas I have come

How to rotate tick labels in polar matplotlib plot?

狂风中的少年 提交于 2019-12-17 19:04:56
问题 I have long identifiers and I would like to make a radial plot where ticks are all at different angles. For example, the first tick on the right at 0 degrees should have a 0 degree angle. The one at the top should be 90 degrees. The one at 270 degrees on the left should be 0 degrees. I want it to look reminiscent of a radial dendrogram. Using matplotlib 2.0.2 and python 3.6.2 Is this possible in matplotlib to rotate individual tick labels or add text labels separately? NOTE: I have updated