Fix Node Position in D3 Force Directed Layout

Set d.fixed on the desired nodes to true, and initialize d.x and d.y to the desired position. These nodes will then still be part of the simulation, and you can use the normal display code (e.g., setting a transform attribute); however, because they are marked as fixed, they can only be moved by dragging and … Read more

Construct a manual legend for a complicated plot

You need to map attributes to aesthetics (colours within the aes statement) to produce a legend. cols <- c(“LINE1″=”#f04546″,”LINE2″=”#3591d1″,”BAR”=”#62c76b”) ggplot(data=data,aes(x=a)) + geom_bar(stat=”identity”, aes(y=h, fill = “BAR”),colour=”#333333″)+ #green geom_line(aes(y=b,group=1, colour=”LINE1″),size=1.0) + #red geom_point(aes(y=b, colour=”LINE1″),size=3) + #red geom_errorbar(aes(ymin=d, ymax=e, colour=”LINE1″), width=0.1, size=.8) + geom_line(aes(y=c,group=1,colour=”LINE2″),size=1.0) + #blue geom_point(aes(y=c,colour=”LINE2″),size=3) + #blue geom_errorbar(aes(ymin=f, ymax=g,colour=”LINE2″), width=0.1, size=.8) + scale_colour_manual(name=”Error Bars”,values=cols) + … Read more

Heatmap in matplotlib with pcolor?

This is late, but here is my python implementation of the flowingdata NBA heatmap. updated:1/4/2014: thanks everyone # -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # ———————————————————————— # Filename : heatmap.py # Date : 2013-04-19 # Updated : 2014-01-04 # Author : @LotzJoe >> Joe Lotz # Description: My attempt at reproducing the FlowingData graphic in … Read more

A good book for learning D3.js [closed]

As @Autio already mentioned, there are the tutorials from Scott Murray on his website. You will also note that on his site, he has a link to his recent d3 book, Interactive Data Visualization for the Web. However, that book is now available online for free, along with embedded jsbin examples. http://chimera.labs.oreilly.com/books/1230000000345/index.html So if you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)