Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Well I have a network dataset in NodeXL and I am trying to visualize it on a world map. My dataset has
Nodes with an attribute of a country
Links. Unweighted connections between the nodes
I tried to do it with NodeXL and exporting the file and importing to Gephi. But, I cannot find a way to visualize it on a world map in base of the attribute of nodes.
Also, I know about D3.js but I cannot find any example or tutorial with networks on maps.
Can you please provide me with examples in NodeXL, Gephi, D3.js or any other library to do this.
Imagine the result something like this:
In Gephi, you can use a map-based layout to visualize your network based on node location. You need to have two attributes containing the geocoded coordinates of your nodes: latitude and longitude. There are two plugins you can use for the visualization (neither comes with Gephi by default, you have to install them from Tools -> Plugins):
GeoLayout - when you apply that one, you have to specify the names of the attributes where longitude and latitude are recorded and select a projection (e.g. Mercator). Your nodes will be laid out accordingly.
Map of countries - that's a plugin that displays a (fairly crude - not too detailed) outline map as a background to your network.
You can use both in sequence - though frankly I've had more success using GeoLayout, exporting the result to a vector graphic, an overlaying it on top of a map image. If your network is large and nicely spread across the geographic area, you won't even need to overlay it on a map - it will already look like one. In the Facebook visualization you've posted above for example, the outlines of continents emerge just based on where nodes/users are concentrated.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have two shapefiles of the state of NSW, Australia. The first one has some regions that are useful for economic reasons, while the second has information about the koala population, in much smaller polygons.
Here I show both maps that I get when I plot these shapefiles:
Areas of NSW
Probability of finding a Koala
What I'm attempting to do is to add the region name of the first picture to each of the quadrants of the second file.
Is this possible? Which would be a method to match the polygons of both files? Thanks
You are likely looking for sf::st_join().
What it does is it transfers the non-spatial information from one {sf} object to another based on spatial relation. For the function to work both spatial objects need to have the same CRS (so consider sf::st_transform() if they do not).
Note that the order matters: you either add koala info to administrative areas, or area info to koala regions.
Also note that some koala regions are likely to straddle the border of two regions; these will be split. So expect slightly more rows coming out that what went in.
This question can be considered to be an extension of Network chord diagram woes in R
Is it possible to change the colors of the links in the plot based on whether the node on which the cursor is set is a source node or a target node as done in the following example?
https://bl.ocks.org/mbostock/7607999
I don’t intend to make the question more verbose by giving a reproducible example as the codes are already available in the links. Any help would be great.
I am creating a network of scientific literature, where nodes represent publications and edges citations. I used igraph to plot my example set in a circle layout.
Network,organized in circle layout
What I wnat to do next is organize the network on a time axis. I have the publication year as node-attribute in a column of the nodes file. Is there a way to organize this directed network by time?
The result should finally a bit like this:
Citationnetwork, y-axis=timeline, created with www.citnetexplorer.nl
One idea could be a treelayout and then truncating each year - tried hard, but couldn't manage. Any advice?
I'm not sure if this is the most elegant solution (or timely given that this question is over three years old...), but it might work if the network is small.
You can use tkplot(), which will pull up a window to help you manually plot the nodes. You need to have XQuartz if you're running things on a mac. The clearest bit of instruction I've found is here.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
This is a question both about best practices for visual representation of data and about how to draw plots in R/ggplot2.
I am trying to find a way to graphically represent the story told here:
"We had 2000 test cases, of which 500 had errors. After investigation, we found that 400 of the tests were Big and 1600 were Small; only 25 of the Big tests had errors, so we set them aside, leaving 1600 Small tests, of which 475 had errors. We then found that 400 of the Small tests were Clockwise and 1200 were Counter-Clockwise; only 20 of the Small Clockwise tests had errors, so we set them aside, leaving 1200 Small Counter-Clockwise tests, of which 455 had errors."
In other words, I am using categories to separate my test cases, and I want to represent how the fraction of errors in each category changes with my progress.
Here's some R with the data:
tests <- data.frame(n.all=c(2000,400,1600,400,1200),n.err=c(500,25,475,20,455),sep.1=as.factor(c("all","Big","Small","Small","Small")),sep.2=as.factor(c("all","all","all","Clockwise","Counter-Clockwise")))
With this small amount of data, a simple numeric table might be the best choice; let's assume that the story continues, with more and more separating categories being used, so that simply listing the numbers isn't the best choice.
What would be a good way to represent this data? I can think of a few possibilities:
Pie charts, showing slices of the pie being taken away, and the breakdown of errors/no errors in what remains
Bar charts, similar
Bar charts with ribbons showing the "flow" of separating away categories, like Minard's chart of Napoleon's march
Similar, but with the bar charts showing the fractions horizontally rather than vertically
All four methods show the absolute amount of test cases decreasing, and the fraction of errors in the separated category as well as what remains. I think I like #4 best, but I've got an open mind.
How should this kind of data be represented, and can R/ggplot2 be used to do so?
Remember the 3 things that should be in line when drawing graphs; the message you are telling, the message the data is telling you and the message the graph is telling you.
In my opinion your option 4 is the best one to get the message across consistently.
I also arrive at number 4 by sheer elimination: ;)
Columns are not suitable since you are combining vertical representation with a horizontal flow, comparing pie charts are also not easy to do (even within a pie chart it is already difficult to compare the different parts) so they are not an option either. Leaving you with option 4 indeed :)
You can also try a Sankey Diagram. Sankey Diagrams in R? might be helpful
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am trying to convert the SVG File to SHP (Shape File format) and then get it imported into GeoServer.
Is there any convertor available OR is there any mediating format in which I can get it converted and finally get it in SHP format?
I already have shape file of Map of India. Now, there are some odd 60 districts got added in recent years. New districts are separate from the old ones. So, the total area of the country has not changed, but got divided.
What I am thinking is, if I can merge the new layer which I have of new districts in SVG format to the original SHP file data and get the final coordinates mapped according to the SHP file, then the problem can be sorted.
If anyone has done it and can help, will be great!! Thanks!!
Highly unlikely. SVG is a 'drawing' format, and so there's no guarantee that the lines have coordinates that are anything in the real world - they might be in centimetres based on a piece of A4-size paper.
So you would have to at least work out the transformation from those coordinates to lat-long, or some other coordinate system. This may be non-linear...
However SVG is an XML-based file, so you can open it in a text editor and get a look at it. If you can figure out what elements hold the coordinates you need, then you can write a script (I'd do it in Python, but whatever language you can program in that has XML support will do) to strip out the coordinates. Then it might be possible to think about converting them to a shapefile - or maybe GML - an XML-based standard format for geographical data.
But to be honest, it might be much easier to source a shapefile with the boundaries you want in it.