add legend to graph according to node colors using Rcy3 - graph

I'm an advanced R user, but have just started recently using Rcy3 to create better visualisations of my graphs.. problem is I don't know how to add a legend to my figure that would explain the coloring of my nodes.

You may want to look at the app "LegendCreator". It's sort of in the beta stage, but it can be useful particularly for gradient legends. It also supports automation, although generally, you'll want to manually position the legend.
-- scooter

Related

External node color in Gephi

I'm trying to create a graph in Gephi. This graph is undirected and has over 100 nodes. I would like to color the nodes in this graph according to my convenience. Say I'd like to color the nodes in 9 different colors. For doing this, I downloaded a plugin to Gephi which may be found here.
Though the plugin works, I still have to go and enter the color value for every single node manually. There doesn't seem to be a way to do this programatically. And I'd have to create about 10 such graphs, so that means a lot of manual labor.
Can someone help me out with this problem? Does someone know a better way to have custom colors for each node generated programatically? At this point, I'm generating a .gdf file, the format looks something like this.
I also know that Gephi is quite buggy, is there any other graph visualization software that I can use? Out of the other usual things that one does to the graph, I definitely want the capability to set edge weights. In other words, I'd like to make the edges thicker if the edge weight is more and vice-versa.
I can't use D3 coz I don't know Javascript. I looked into using GraphViz but it seems like it requires a lot of manual manipulation of the graph file. I'd like to have something that I'm able to generate programatically.
What seems to be working is to add a column named color VARCHAR where you add the color hex value prepended with the # sign and no quotes.
Example:
nodedef> name,label,color VARCHAR
a,"Apple",#00ffdd
b,"Banana",#00ddff
c,"Cherry",#dd00ff
d,"Did it!",#0012ca
e,"Ed 209",#121212
edgedef> node1,node2,weight
a,b,2
b,c,30
b,d,0.4
d,e,200
Edit:
For a more informed answer take a look at the Gephi documentation. The color values in the link are rgb triples but I tried with hex and it worked

ggplot: Pallete Greyscale On Print, Colourful on Screen [duplicate]

I've started to produce the charts for a paper. For some of them which are bar charts I've used the "Pastel1" palette (as recommended in the book on ggplot2, pastel colours are better than saturated ones for fill areas, such as bars).
The problem with Pastel1 at least is that when printed on a B&W laser printer, the colours are indistinguishable. I don't know if the readers will view the paper on screen or will print it on B&W, so I'm looking for either of the following:
how to add hash lines to a palette such as Pastel1 (hopefully the hash lines are also subtle)
a colour palette easy on the eyes that also produces distinct grey areas for B&W for, say, up to 3-4 different colours.
Granted, I could find the latter by experimenting and using toner, but perhaps this has already been solved, I suppose it's a common problem. And yes, I did google for this, but didn't find anything pertinent.
Thank you.
Use http://colorbrewer2.org/ and only show colour schemes that are printer friendly.
Also see scale_fill_grey.
Currently it's not possible to used hash lines due to a limitation in the underlying grid drawing package.
There is the col2grey function in the TeachingDemos package that will convert a set of colors to an approximation of the grey color that will result from printing. You can use this to try different pallettes without wasting toner/paper.
Use this to select another color combination (gray scale option included)

Are there good predefined color sequences for different data in one plot?

A while ago, I asked How to change Lattice graphics default groups colors?, and got a helpful response from BenBarnes. This allowed me to define more than 7 cycling colors for different data in the same plot in R's Lattice package, which I did. However, I found that it's difficult to define more than 9, maybe 10 colors are not (a) hard to see on a white background, or (b) include pairs of colors that look very similar. (That might be why seven colors is Lattice's default, obviously.) It occurs to me, though, that there are people out there who are much better at managing colors in information display than I am, and that maybe someone had already defined a good list of 10, 12, maybe even 15 colors for display of data in the same plot. Anybody know of such a list? Any color specification that I can convert into a Lattice format would work. If it's already been done in Lattice, even better! (Is there a better place to ask this question??)
There's a large body of work on choosing colors. Check out the RColorBrewer and colorspace packages as a starting point. In the documentation for colorspace there is a link to an excellent paper (and the vignette summarizes much of the paper). And think about your color blind colleagues, with dichromat.
In general, I think it is very difficult to pick a large set of colors that don't end up being hard to distinguish from one another. When I am looking for a large number (>8) of colors that I want to be noticeably distinct and aesthetically pleasing, I usually use the rich.colors palette in the gplots package. I find it more useful than the similar rainbow palette, because the colors don't wrap around on each other.

How to draw a directed graph with labels on edges using quickgraph and graph# libraries?

I'm trying to draw a directed graph with labels on edges. I'm using graph# (graphsharp) and quickgraph, and I saw an explanation in the forums about how to add labels (it is not supported by the library), but cannot manage to implement myself. If someone could provide a working example using these two libraries I would be very thankful.
Update:
I'm now looking for something a little more complicated: My edges behave like nodes, they have connections to other nodes and have a name-tag. So they are like any other node, and when I draw the graph these edge-nodes must appear exactly in the middle of a certain connections. Any ideas?
Although it's not documented, QuickGraph supports output to other formats, like DGML. VS 2010 includes a very basic DGML viewer. It may be possible to output DGML so that the resulting graph has edge labels. However you will likely need to add support yourself.
Download the QuickGraph sources and play around with it. I'm a committer on the project, so if you figure it out let me know and we'll get your changes into the project.

ggplot: recommended colour palettes also distinguishable for B&W printing?

I've started to produce the charts for a paper. For some of them which are bar charts I've used the "Pastel1" palette (as recommended in the book on ggplot2, pastel colours are better than saturated ones for fill areas, such as bars).
The problem with Pastel1 at least is that when printed on a B&W laser printer, the colours are indistinguishable. I don't know if the readers will view the paper on screen or will print it on B&W, so I'm looking for either of the following:
how to add hash lines to a palette such as Pastel1 (hopefully the hash lines are also subtle)
a colour palette easy on the eyes that also produces distinct grey areas for B&W for, say, up to 3-4 different colours.
Granted, I could find the latter by experimenting and using toner, but perhaps this has already been solved, I suppose it's a common problem. And yes, I did google for this, but didn't find anything pertinent.
Thank you.
Use http://colorbrewer2.org/ and only show colour schemes that are printer friendly.
Also see scale_fill_grey.
Currently it's not possible to used hash lines due to a limitation in the underlying grid drawing package.
There is the col2grey function in the TeachingDemos package that will convert a set of colors to an approximation of the grey color that will result from printing. You can use this to try different pallettes without wasting toner/paper.
Use this to select another color combination (gray scale option included)

Resources