Last active
August 29, 2015 14:19
-
-
Save al2na/f07335599062ba14c54e to your computer and use it in GitHub Desktop.
rcharts NVD3 scatterplot with different shapes and color code adjustment. Works in reveal.js slides
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
y=readRDS("data/othersmRNA.pca.table.rds") | |
p1=nPlot(PC2 ~ PC1, data = y,group="cellDisease", type = "scatterChart", | |
filter="disease") | |
p1$xAxis(axisLabel = 'PC1') | |
p1$yAxis(axisLabel = 'PC2') | |
p1$chart(color = y$color) # color for each dot | |
p1$chart(sizeRange = c(100,100)) # for dot sizes | |
#here the magic | |
p1$chart(scatter.onlyCircles = FALSE) # it sets the js to have only | |
p1$chart(shape = '#! function(d){return d.shape} !#') # here you hack-in shapes, from the table created earlier | |
p1$set(height = 600) # set the height of the plot in pixels | |
p1$show('iframesrc') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment