Gnuplot, plot in polar coordinates - plot

I have a file with 17294 particles (17294 lines) and for each particle I have θ,r in 2 columns. Here are the coordinates of the first 4 particles (radians,AU):
0.49270177616816235 2.5620755754079405
0.90238849710652080 2.5619357395318492
-0.40974974698351807 2.5078418996893919
1.2044083323780090 2.5701067236161976
I am trying to create a plot (via Gnuplot) with my data, the radius of the particles (distance from the Sun) is from 2.5 to 8 AU and when I plot I get only half of the disk:
I want to create the whole disk, I know that radius isn't negative, so I tried to:
set rrange[8:8]
but it didn't work.
How can I do this ?

Related

How to plot an array over radial coordinates?

I have a matrix C (1000,1024), which consists of concentration values over the time t and the radius r. I have standardised the 1024 radius values from 0 to 1.
Now I want to display the concentration values over the radius at a certain time t, namely as a radial plot.
My idea would be to export an array from the matrix and display it radially. Here I assume that the concentration is constant over every angle of the circle and only changes outwards over the radius.
The filled circle should change colours depending on the concentration, like a 3D plot with colourbar.
How can I represent this with a code?
Many thanks in advance.

Divide Voronoi cell using azimuth in R

I have generated a Voronoi tessellation for N number of points in 2D space using the deldir R package.
Now I want to divide each Voronoi cell into three Voronoi cells according to given azimuth described as below:
Azimuth is given as an input. E.g.: azimuth = 0 means an area should be separated by 2 lines at angle = 0 to angle = 120. Next area by angle = 120 to angle = 240 and last area is the remainder.
Azimuth is the starting angle from north for this separation and always it spans 120 degrees. In more detail, from each point Voronoi is generated exactly three lines are drawn dividing previous Voronoi cell into three Voronoi cells.
Can this be achieved using the deldir package? if not can anyone suggest a extension for this?
I don't know any easy/implemented way of doing this. However, you could try creating those lines manually.
I would try something along the lines of:
Access the coordinates of the edges of a voronoi polygon using deldir()
Convert the coordinates into line objects using the sp package
Create line objects that reach from the "center"-point to the border of the plot (calculating the end points based on your azimuth)
Find intersections of the lines created in 3 with the lines created in 2 (check How to get the intersection point of two vector?)
Create new (shorter) lines starting from your original point and ending at the intersection point retrieved from step 4.
Plot the lines created in 5.
Loop for every polygon
This may well be a very clumsy solution, but it is the only workaround I could come up with ;)

Space time 3d map

I would like to plot 3d spheres over a map in specific points.
Radious of the spheres measures my variable in one time.
I have x,y for east and north axis in UTM projection.
In z is the time and I have 2 observations in 4 positions of my map.
I want to present how changed my variable in the space and time.
The image I have in Shapefile or Geotiff format.
I saw another 3d plot similar to this one but not with maps.
Example 1
Example 2
My plot should be like this one:

Draw a translucent sphere using rgl in R

I have a set of data, looks like:
x y z
1 1 2 1
2 3 5 7
3 -3 2 4
4 -2 1 1
so each row record the dot coordinate in a 3-D space. I want to plot all the dot as points except for one, say no.15 as a translucent sphere, with radius I can set. Then I can see from the plot that which of those points in the data are included in the sphere. I'm using RGL package right now and did the following:
> open3d()
> plot3d(readin,col=3,type="p")
> plot3d(readin[15,],col=2,add=T,type="s",radius=0.1)
So the first plot command plotted the whole set as scatter plots and the second plot command picked the 15th row of the data and plot it as a sphere and add it to the previous canvas. I just wondering if I can make the sphere translucent so that I can see which dots a included in the sphere which means those dots are very near to the one I select.
Is there a way to do this by RGL Or you can provide me another ways to complete this task?
Thanks!
I think what you are looking for is the argument alpha.
Example
df <- data.frame(x=c(1,3,-3,-2), y=c(2,5,2,1),z=c(1,7,4,1))
library(rgl)
open3d()
plot3d(df,col=3,type="p", radius=0.5)
plot3d(df,col=rgb(1,0,0.3),alpha=0.5, add=T,type="s",radius=1)
You can plot transparent spheres using the alpha argument to spheres3d. You can rotate the plot to move the box line behind the sphere to prove it's transparent.
spheres3d(dat[4,],col=rgb(1,0,0), alpha=0.9) # transparent red.
(I tried to do it with the alpha argument to rgb but it failed.)
If you just want to find out which points are within a certain radius of point 15 then you can calculate the Euclidean distance from each point to point 15 and see which of those distances are less than the radius. No plotting needed (though you could plot those points as a different color to highlight them. The dist function is one way to compute the distances, or it is simple to program yourself.

drawing a circle around many points with different radius

I can draw a circle around a given point (x,y) with a command like flowing (here for example point is at (X=5,Y=7) and the circle have a radius R=2.73):
set object 1 circle at 5,7 size first 2.73 fc rgb "navy"
Now, if I have many points (in a txt file where each line is "x y") and I want to draw a circle around each point with different specified radius. Should I repeat the command "set object i circle at Xi,Yi size first Ri fc rgb "navy"" for each point i ?!
It looks like you may want to use the with circles option. If you have a data file with three columns (x y radius), the following command will plot circles with radii from the file at each point:
plot 'datafile' u 1:2:3 with circles
http://gnuplot.sourceforge.net/demo/circles.html
You can create a loop in gnuplot for multiple circles.
do for[k=1:20]{
set object k circle front at k*3,0 size 1 fillcolor rgb "black" lw 1
}
This will create 20 circles at x points (3,6,9...) of radius 1. Please keep in mind to set the object count with the loop variable too ("object k").

Resources