dot

Graph of Graphs in Graphviz

懵懂的女人 提交于 2019-12-03 04:23:43
I have a collection of digraphs encoded in the DOT language. I want to construct a graph-of-graphs such that each node in the super-graph is one of these digraphs. Is there a way to do this within the GraphViz framework? I know that gvpack will allow me to assemble multiple graphs into one .dot file. But I don't know if it will allow me to declare edges between those graphs. The short answer is that gvpack does not declare edges between the sub-graphs. Indeed, when there are common node names between sub-graphs, gvpack renames them to avoid clashes. However, that is fixable. For example, given

How to style carousel dots?

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How do I style my carousel dots to become like this ? Here is what I have now. Here is how I style it. HTML <div class = "row slick" > // a bunch of images </div> 回答1: Here you go. :) nav . carousel : hover { cursor : default ; } /* Hide the radio button */ nav . carousel input [ type = radio ] { display : none ; } /* All styling takes place on the label element */ nav . carousel label { display : inline - block ; background : #ddd; overflow : hidden ; text - indent : - 999px ; border - radius : 100 %; width : 10px ; height : 10px

whats the difference between dot operator and scope resolution operator

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I just wanted to know the difference between . operator and :: operator? 回答1: The former (dot, . ) is used to access members of an object, the latter (double colon, :: ) is used to access members of a namespace or a class. Consider the following setup. namespace ns { struct type { int var; }; } In this case, to refer to the structure, which is a member of a namespace, you use :: . To access the variable in an object of type type , you use . . ns::type obj; obj.var = 1; 回答2: Another way to think of the quad-dot '::' is the scope resolution

Add labels on lattice xyplot

匿名 (未验证) 提交于 2019-12-03 03:02:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have created a xyplot with lattice library(lattice) X1=c(5, -2, 1, -3) X2=X1^2 names=paste("dot", 1:4, sep="") xyplot(X2~X1, data=data.frame(X1, X2), pch=20, cex=1:4) Now I want to add a label (text) for each dot. The info is in names=paste("dot", 1:4, sep="") I have tried with no success the following panel.text(x=X2, y=X1, names) or, using directlabels library(directlabels) p=xyplot(X2~X1,data=data.frame(X1, X2), pch=20, group=names, cex=1:4) direct.label(p,smart.grid,FALSE) but I don't like it much because I had to split into groups

Search and replace with sed when dots and underscores are present

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How do I replace foo. with foo_ with sed simply running sed 's/foo./foo_/g' file . php doesn't work. Thanks! 回答1: Escape the . : sed 's/foo\./foo_/g' file.php Example: ~ $ cat test . txt foo . bar ~ $ sed 's/foo\./foo_/g' test . txt foo_bar 回答2: Escape the dot with a \ sed 's/foo\./foo_/g' file . php If you find the combination of / and \ confusing you can use another 'separator' character sed 's#foo\.#foo_#g The 2nd character after the s can be anything and sed will use that character as a separator. 回答3: Interestingly, if you

Python, PyDot and DecisionTree

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to visualize my DecisionTree, but getting the error The code is: X = [i[1:] for i in dataset]#attribute y = [i[0] for i in dataset] clf = tree.DecisionTreeClassifier() dot_data = StringIO() tree.export_graphviz(clf.fit(train_X, train_y), out_file=dot_data) graph = pydot.graph_from_dot_data(dot_data.getvalue()) graph.write_pdf("tree.pdf") And the error is Traceback (most recent call last): if data.startswith(codecs.BOM_UTF8): TypeError: startswith first arg must be str or a tuple of str, not bytes Can anyone explain me whats the

“RuntimeError: Make sure the Graphviz executables are on your system&#039;s path” after installing Graphviz 2.38

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I downloaded Graphviz 2.38 MSI version and installed under folder C:\Python34 , then I run pip install Graphviz , everything went well. In system's path I added C:\Python34\bin . When I tried to run a test script, in line filename=dot.render(filename='test') , I got a message RuntimeError: failed to execute ['dot', '-Tpdf', '-O', 'test'], make sure the Graphviz executables are on your systems' path I tried to put "C:\Python34\bin\dot.exe" in system's path, but it didn't work, and I even created a new environment variable "GRAPHVIZ_DOT" with

Numpy AttributeError: &#039;float&#039; object has no attribute &#039;exp&#039;

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Here is my code: def sigmoid(X, T): return (1.0 / (1.0 + np.exp(-1.0*np.dot(X, T)))) And this line gives me error "AttributeError: 'float' object has no attribute 'exp'". X, t are Numpy ndarray. 回答1: Probably there's something wrong with the input values for X and/or T. The function from the question works ok: import numpy as np from math import e def sigmoid(X, T): return 1.0 / (1.0 + np.exp(-1.0 * np.dot(X, T))) X = np.array([[1, 2, 3], [5, 0, 0]]) T = np.array([[1, 2], [1, 1], [4, 4]]) print X.dot(T) print # Just to see if values are ok

d3.js User viewer chart

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Developing a chart which will provide a user a visual for who has viewed them. The inner circle shows matches (user following/being followed), the next ring - user following others, the last ring - the followers of the user. I've mocked the cy, cx positions, but what would it take to position them like this - to bound the orange circles into the various circle quadrants? http://jsfiddle.net/NYEaX/281/ sampleSVG.selectAll("circle") .data(dataset) .enter().append("circle") .style("stroke", "gray") .style("fill", "orange") .attr("r", 6) .attr(

Graphviz: How to go from .dot to a graph?

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I can't seem to figure this out. I have a .dot file, which is valid according to the syntax. How do I use graphviz to convert this into an image? (note that I'm on Windows, not linux) 回答1: type: dot -Tps filename.dot -o outfile.ps If you want to use the dot renderer. There are alternatives like neato and twopi. If graphiz isn't in your path, figure out where it is installed and run it from there. You can change the output format by varying the extension of the filename specified with -o . If you're using windows, check out the installed tool