data-visualization

ggplot2 multiple stat_binhex() plots with different color gradients in one image

做~自己de王妃 提交于 2019-11-30 06:56:10
I'd like to use ggplot2's stat_binhex() to simultaneously plot two independent variables on the same chart, each with its own color gradient using scale_colour_gradientn(). If we disregard the fact that the x-axis units do not match, a reproducible example would be to plot the following in the same image while maintaining separate fill gradients. d <- ggplot(diamonds, aes(x=carat,y=price))+ stat_binhex(colour="white",na.rm=TRUE)+ scale_fill_gradientn(colours=c("white","blue"),name = "Frequency",na.value=NA) try(ggsave(plot=d,filename=<some file>,height=6,width=8)) d <- ggplot(diamonds, aes(x

R: Plot trees from h2o.randomForest() and h2o.gbm()

最后都变了- 提交于 2019-11-30 05:05:49
Looking for an efficient way to plot trees in rstudio, H2O's Flow or in local html page from h2o's RF and GBM models similar to the one in the image in link below. Specifically, how do you plot trees for the objects, (fitted models) rf1 and gbm2 produced by code below perhaps by parsing h2o.download_pojo(rf1) or h2o.download_pojo(gbm1)? # # The following two commands remove any previously installed H2O packages for R. # if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) } # if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") } # # Next, we download

d3.json: “Uncaught TypeError: Cannot read property 'children' of undefined”

会有一股神秘感。 提交于 2019-11-30 04:54:04
问题 I am trying out d3 as a tool for representing biological data. I am trying to open the following example in my chrome browser so that I can understand how it works. Unfortunately I get the following error "Uncaught TypeError: Cannot read property 'children' of undefined ". http://bl.ocks.org/4063550 If you click the link, the source code for both the .html file and the .json file are displayed below the output of the visualization. Clearly the visualization is working on the above page. I'm

Scatter Plots in C++ [closed]

一个人想着一个人 提交于 2019-11-30 04:43:23
What is the best way to graph scatter plots in C++? Do you write data to a file and use another tool? Is there a library like matplotlib in Python? I always write out data and then using gnuplot to create my graphs. It is by far the best way I have found of producing graphs in a variety of formats: eps, png, jpeg, xpm, you name it. gnuplot will do scatter plot very easily. Provided the x and y values are in 2 space-separated columnss, then plot "data.txt" using 1:2 Will give you a quick scatter plot. Then you can adjust it and what not using other gnuplot commands. If you are involved in

What's the fastest force-directed network graph engine for large data sets?

点点圈 提交于 2019-11-30 03:36:11
We currently have a dynamically updated network graph with around 1,500 nodes and 2,000 edges . It's ever-growing. Our current layout engine uses Prefuse - the force directed layout in particular - and it takes about 10 minutes with a hefty server to get a nice, stable layout. I've looked a little GraphViz 's sfpd algorithm, but haven't tested it yet... Are there faster alternatives I should look at? I don't care about the visual appearance of the nodes and edges - we process that separately - just putting x, y on the nodes. We do need to be able to tinker with the layout properties for

Plot point markers and lines in different hues but the same style with seaborn

点点圈 提交于 2019-11-30 03:35:07
问题 Given the data frame below: import pandas as pd df = pd.DataFrame({ "n_index": list(range(5)) * 2, "logic": [True] * 5 + [False] * 5, "value": list(range(5)) + list(range(5, 10)) }) I'd like to use color and only color to distinguish logic in a line plot, and mark points on value s. Specifically, this is my desired output (plotted by R ggplot2): ggplot(aes(x = n_index, y = value, color = logic), data = df) + geom_line() + geom_point() I tried to do the same thing with seaborn.lineplot, and I

How to have a new line in a `bquote` expression used with `text`?

浪子不回头ぞ 提交于 2019-11-30 03:10:19
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 6 years ago . I want to have a new line in my bquote envrionment, how can I do this? my code: test<-c(1,2,3,4,4.5,3.5,5.6) test2<-0.033111111 plot(test,c(1:length(test))) segments(4,0,4,23,col="red",lwd=2) text(5, 4.5, labels = bquote(Qua[0.99] == .(round(test2,4))),col="red", cex = 1.4) And I want to have a new line after the equal sign, so this should give: VaR_0.99 = 0.03311 and not VaR_0

Stacking multiple plots, vertically with the same x axis but different Y axes in R

烂漫一生 提交于 2019-11-30 02:00:29
I have a data.frame with multiple time series vectors against a date:time vector. I would like to plot all of the relevant vectors, vertically stacked on separate graphs with the same X axis but unique Y axes. A graph similar to this one: my data looks like this: dt <- structure(list(DEPTH = c(156, 156.5, 157.4, 158.15, 158.8, 159.2, 159.75, 160.35, 160.85, 161.1, 161.6, 162.05, 162.5, 162.65, 163.15, 163.45, 163.55, 163.8, 163.65, 163.75, 163.8, 163.8, 163.75, 164.45, 164.8, 165.35, 165.65, 165.75, 166.1, 166.75, 167, 167.2, 167.65, 168, 168.8, 169.3, 169.7, 170.2, 170.65, 170.9, 171.45, 171

Are there any PHP code visualization tools?

半世苍凉 提交于 2019-11-30 01:57:30
Looking for software that will analyze php code (i.e. all of wordpress or the thematic theme) and show me pretty pictures (perhaps a block diagram ) of all the connections to help me more quickly get an understanding of where things are and what's connected to what. Ideally, this software would run on a Mac, but I'll take anything: Windows, Linux, web-based, etc. KCachegrind - With Xdebug you can profile the execution of your scripts, KCachegrind can generate some pretty awesome call graphs from this nwire for Eclipse [UPDATE: This answer does not handle namespaces, so is basically obsolete. I

Treemap visualization in Python [closed]

隐身守侯 提交于 2019-11-30 01:51:14
I'm interested in drawing a treemap : What is the easiest way to make one in Python? Is there a library that could produce such a graphic, given the proper input data? nkint The SciPy cookbook includes an example using matplotlib , but without labels . IA link: https://web.archive.org/web/20150324163314/http://wiki.scipy.org/Cookbook/Matplotlib/TreeMap You can use Pygal library, this is so simple http://pygal.org/en/stable/documentation/types/treemap.html Another solution is you can use squarify library, here's a code that I was used import matplotlib import matplotlib.pyplot as plt import