[SOLVED] X and Y coordinates of plotted points.

Evolution and dynamics on networks in Gephi: UI, data formats, algorithms...
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
ndevanur
Posts:5
Joined:02 Mar 2011 23:02
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[SOLVED] X and Y coordinates of plotted points.

Post by ndevanur » 02 Mar 2011 23:09

Is there any way to get the X and the Y coordinates of all the nodes plotted in the gephi layout ? I am working on dynamic graphs and I want to keep the location of the nodes fixed as the graph evolves. Is there any way to do this ?

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: X and Y coordinates of plotted points.

Post by admin » 03 Mar 2011 16:00

Hi,

Go to the Data Laboratory, select all nodes, right click and choose "Settle all". It will fix the nodes.

ndevanur
Posts:5
Joined:02 Mar 2011 23:02
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: X and Y coordinates of plotted points.

Post by ndevanur » 03 Mar 2011 18:19

Hi,

Thanks a lot for the reply ! .. But I would like to tell you the exact problem I am facing. I am using the Graph Streaming plugin to input some Dynamic graphs into Gephi. When I am doing this I would like the nodes to be fixed at the same position once they are inside gephi, as this would help me in tracking them easily subsequently. But this would mean that I wont be able run any layout algorithm to get a good layout of the graph ( please correct me if I am wrong). One way I thought of getting around this problem, would be to run my experiment in two passes.
1. In the first pass, I input my dynamic graph ( which has a start time and end time ) through graph streaming untill completion, allowing the nodes to change their postions during the progress. This would let me run any layout algorithm and at the end I will have the final graph with a good layout. At this point I would like to capture the X and Y coordinates of all the nodes.
2. In the second pass, I rerun the input, but this time I would specify the X Y coordinates of the nodes ( which I captured at the end of the first pass ). This way at the end of the second pass I would have the same layout which I would have got by running a Layout algorithm and also at the same acheive the motive of having the nodes fixed as the graph grows.

Could you kindly suggest me if this is possible. If somehow I can get the X Y coordinates of plotted points, I should be able to acheive what I want !.. Thanks once again for your help

Regards,
Nishchal.

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: X and Y coordinates of plotted points.

Post by admin » 03 Mar 2011 23:46

Okay I understand, here is an easier way to achieve it:

1. Load your graph in Gephi using the Graph Streaming.
2. At the end, runs a layout until you think it's okay.
3. Open the Timeline (Filter > Dynamic), and use it like this:



If the timeline is not available, save your graph as a GEXF file (File > Export > Graph File), then Create a new project (File > New Project), and open this file.

ndevanur
Posts:5
Joined:02 Mar 2011 23:02
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: X and Y coordinates of plotted points.

Post by ndevanur » 04 Mar 2011 03:52

Gr8 !! GigaThanks !!

Nishchal

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: X and Y coordinates of plotted points.

Post by mbastian » 04 Mar 2011 07:39

If you want access the X, Y coordinates programmatically, simply do

Code: Select all

Node n = ...
float X = n.getNodeData().x();
float Y = n.getNodeData().y();
More details on the Javadoc

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable