Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How can I make this particular data representative figure?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
mrmarcdee
n00b
n00b


Joined: 18 Jan 2010
Posts: 67

PostPosted: Tue Sep 18, 2012 9:23 pm    Post subject: How can I make this particular data representative figure? Reply with quote

Hi,

I don't know where to go to figure this out, or even where to ask, so hopefully the smart gentoo users can help!

I am modelling movement of an organism and want to visually represent the amount of time that it spends travelling in certain directions. Particularly I have split up the full 2PI of directions into 8 bins. I can plot figures like the following with the data that I have https://docs.google.com/open?id=0BxhSJoGQbQSKaXpLTFpmU0pnS2M. I want to somehow create a visual similar to https://docs.google.com/drawings/d/1Wrn0E8mrOR6-mJyojgI2G1Er8083HkFKxoEcu9eaaJ8/edit (I know, that drawing is amazing, you don't have to say anything...), where the lengths of the lines in the certain directions correspond to how long was spent travelling in that direction.

One thought I had was just to take the histogram I already have and in gimp/photoshop somehow curve it into a circle, but I don't know how to do that.

I want this to be an automated process. I suppose I could draw it with glut/opengl, but that sounds like it would take a while.

Thanks for any help or suggestions!
Marc
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 16108
Location: Colorado

PostPosted: Tue Sep 18, 2012 11:27 pm    Post subject: Reply with quote

Both links ask for login.
_________________
lolgov. 'cause where we're going, you don't have civil liberties.

In Loving Memory
1787 - 2008
Back to top
View user's profile Send private message
mrmarcdee
n00b
n00b


Joined: 18 Jan 2010
Posts: 67

PostPosted: Wed Sep 19, 2012 12:38 am    Post subject: Reply with quote

Oh, whoops, was trying to go too fast. Should be fixed now.
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1565
Location: U.S.A.

PostPosted: Wed Sep 19, 2012 1:51 am    Post subject: Reply with quote

It's called a "polar plot". You may also see it referred to as a "radial graph, radar chart, or even spider plot". Lots of graphing/plotting applications will do it (including gnuplot, which we have in Portage, along with a Python wrapper and a library with Ruby bindings).

I would suggest browsing Portage's "sci-visualization" category, and finding the tool that's most appropriate to your purpose that is already set up to crate polar plots. Then you can just feed it the data and let it draw it for you (i.e., make a call to it, or include it in your program),

There are also probably libraries/modules for graphing that can do polar plots in just about any commonly-used programming language.

If you're just doing it manually, to include a few plots in a report or something, you may be able to do it whatever spreadsheet application you are using.

You might even get some ideas about using 3-d graphing (and there are tools in there for that, too). For example, you could show not only the time spent moving in each direction, but the velocity or size or something.
_________________
pjp wrote:
I didn't misquote you, I just misunderstood you.
Back to top
View user's profile Send private message
richk449
Guru
Guru


Joined: 24 Oct 2003
Posts: 345

PostPosted: Wed Sep 19, 2012 5:33 am    Post subject: Reply with quote

The standard polar plot from matplotlib doesn't do quite what you want, but close:
Code:
import matplotlib.pylab as p
theta = [0, p.pi/4, p.pi/2, 3*p.pi/4, p.pi, 5*p.pi/4, 3*p.pi/2, 7*p.pi/4]
r = [0.1,0.3,0.4,0.4,0.3,0.2,0.2,0.3]
fig = p.figure(figsize=[5,5])
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True)
ax.plot(theta, r, lw=3)
ax.set_rmax(1.0)
p.grid(True)
p.show()

With a bit of messing, you could get it to draw lines like you want.
Back to top
View user's profile Send private message
mrmarcdee
n00b
n00b


Joined: 18 Jan 2010
Posts: 67

PostPosted: Wed Sep 19, 2012 4:07 pm    Post subject: Reply with quote

Great! Thanks guys should be enough info to do what I want. I made a simple polar plot in Mathematica with ListPolarPlot https://docs.google.com/open?id=0BxhSJoGQbQSKSk9KZDVWcEZhNEk for now. I'll try in gnuplot (preferred) when I get back home.

Marc
Back to top
View user's profile Send private message
sugar
Guru
Guru


Joined: 07 Aug 2004
Posts: 579
Location: Morrinsville, New Zealand

PostPosted: Fri Sep 21, 2012 12:03 am    Post subject: Reply with quote

I was thinking about this earlier today.

Florence Nightengale published a now famous representation in a report demonstrating the number of losses the British were suffering in the Crimean war were mostly due to preventable diseases due to unsanitary conditions.

Anyway, there's way to accomplish this in excel.

http://distantyetneversoclose.blogspot.co.nz/2012/01/florence-nightingle-circumplex-chart.html
http://www.ozgrid.com/Excel/pie-slice-radius.htm
_________________
Jesus Could Be Their Candidate and the Republicans Would Still Lose
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1565
Location: U.S.A.

PostPosted: Fri Sep 21, 2012 12:12 am    Post subject: Reply with quote

A day late and a dollar short.
_________________
pjp wrote:
I didn't misquote you, I just misunderstood you.
Back to top
View user's profile Send private message
ichbinsisyphos
Guru
Guru


Joined: 08 Dec 2006
Posts: 547

PostPosted: Fri Sep 21, 2012 12:20 am    Post subject: Reply with quote

What's the point of putting the data points in the eight bins? You can add the first data point at the end again, so that it's a closed curve.

It might be worth to look into Python/Matplotlib for data representation if you do this regularly. It really creates plots that are among the most unfugliest.
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1565
Location: U.S.A.

PostPosted: Fri Sep 21, 2012 1:18 am    Post subject: Reply with quote

I agree, if you are using Python. It uses the term "radar chart" (or something like that).
_________________
pjp wrote:
I didn't misquote you, I just misunderstood you.
Back to top
View user's profile Send private message
sugar
Guru
Guru


Joined: 07 Aug 2004
Posts: 579
Location: Morrinsville, New Zealand

PostPosted: Fri Sep 21, 2012 1:26 am    Post subject: Reply with quote

BoneKracker wrote:
I agree, if you are using Python. It uses the term "radar chart" (or something like that).


A day late, dollar short, don't you think?
_________________
Jesus Could Be Their Candidate and the Republicans Would Still Lose
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1565
Location: U.S.A.

PostPosted: Fri Sep 21, 2012 1:31 am    Post subject: Reply with quote

sugar wrote:
BoneKracker wrote:
I agree, if you are using Python. It uses the term "radar chart" (or something like that).


A day late, dollar short, don't you think?

No, his advice was not a dollar short, like yours. In fact, it was so good that even a day late it was valuable.
_________________
pjp wrote:
I didn't misquote you, I just misunderstood you.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum