406 reputation
29
bio website
location
age
visits member for 2 years, 10 months
seen Sep 28 at 18:45

Jan
7
comment How to generate the following partitions
hi all, I've updated the example, as Daniel pointed out an mistake I made. Does this now make more sense?
Jan
7
comment How to generate the following partitions
Hi Daniel(my old friend!), you are definitely right! I missed that part initially. Also, I am not sure how to complete the larger example on my own, since it is quite complex. :(
Jan
7
comment How to generate the following partitions
I know it is difficult to give a rigorous definition. I am not sure how to describe. But I have a vague idea: try to partition the elements as evenly as possible, or maybe the sum of common elements between any two sets is minimized?
Sep
11
comment show density plot on US map
Even I did Reverse/@data, it still does not help. The map seems to be on a different scale than the lat/long.
Sep
11
comment show density plot on US map
@Anon, Please. I think I changed the non-essential part, in particular, the rotate is 0 degree. What do you mean by reverse the coordinates though? :)
Sep
10
comment show density plot on US map
hi Anon, I tried with the above code on US map, but it does not locate the cities correctly. Please help take a look. Thank you.
Sep
10
comment show density plot on US map
data={CityData[{"New York City", "USA"}, "Coordinates"],CityData[{"Boston", "Massachusetts", "USA"},"Coordinates"]} outline=ColorNegate@ Graphics[CountryData["UnitedStates", {"Shape", "Equirectangular"}]]; outline = Graphics[CountryData["UnitedStates", {"Shape", "Mercator"}]];density[data_, r_] := Blur[Graphics[Disk[#, 0.1] & /@ data], r];map[outline_, density_, col_] := ImageCrop@ImageMultiply[ ImageApply[(ColorData[col]@Mean[#] &@#) /.RGBColor[r_, g_, b_] :> {r, g, b} &, density], outline];map[outline, ImageRotate[density[data, 1], 0], "SunsetColors"] Please take a look.
Sep
10
comment show density plot on US map
I wonder why this does not work for US map. data = DeleteCases[ Reverse[CityData[#, "Coordinates"]] & /@ CityData[{All, "UnitedStates"}], Missing["NotAvailable"]]; Show[SmoothDensityHistogram[data, .3, ColorFunction -> "SunsetColors", PlotPoints -> 150, Mesh -> 20, MeshStyle -> Opacity[.1], PlotRange -> All], Graphics[{FaceForm[], EdgeForm[Directive[White, Opacity[.7]]], CountryData["UnitedStates", "Polygon"]}]]
Sep
3
comment density/histogram plot for date-time data
Yes. Or even by 10 minutes, when I have a lot of data. Oh, just upvoted. :)
Sep
3
comment density/histogram plot for date-time data
This is really nice, since I don't have Mma 9. But does this work for time range rather than date range?
May
8
comment How to draw a directed graph with arrows showing vertically from bottom to top
when I havve a larger data set, the graph is messy, for example, edges = {18 -> 40, 18 -> 25, 19 -> 0, 20 -> 0, 21 -> 2, 21 -> 2, 21 -> 8, 22 -> 1, 22 -> 36, 23 -> 3, 23 -> 31, 23 -> 21, 23 -> 22, 24 -> 3, 24 -> 34, 24 -> 27, 24 -> 40, 25 -> 0, 26 -> 1, 26 -> 8, 27 -> 0, 28 -> 3, 28 -> 35, 28 -> 41, 28 -> 4, 29 -> 4, 29 -> 26, 29 -> 40, 29 -> 41, 29 -> 25, 30 -> 1, 30 -> 35, 31 -> 0, 32 -> 0, 33 -> 1, 33 -> 32, 34 -> 1, 34 -> 42, 35 -> 1, 35 -> 37, 36 -> 0, 37 -> 0, 38 -> 1, 38 -> 40, 39 -> 3, 39 -> 41, 39 -> 31, 39 -> 12, 40 -> 0, 41 -> 0, 42 -> 1, 42 -> 17}. How to make it nicer here?
Feb
21
comment How to add vertex/edge labels to existing graph
actually in version 8.0.0.0, it is not working SetProperty[g, {EdgeLabels -> {3 \[UndirectedEdge] 4 -> "COOL"}, VertexLabels -> {1 -> "STUFF"}}]. Looks like SetProperty can only set one property at a time.
Feb
21
comment VertexLabelStyle not found in Mathematica 8.0.0.0
@kguler: it says Graph::optx: Unknown option VertexLabelStyle in
Feb
18
comment How to write a function to add edges or vertex to a graph
I guess I wanted to know what if I mixed the newvertices_List and newedges_List in a single list?
Feb
17
comment How to write a function to add edges or vertex to a graph
Can I add a mixture list of vertices and edges to an existing graph? How to write such a function addToGraph[g, {4, 1 \[UndirectedEdge] 2}] which will add another vertex 4 and an edge between 1 and 2? Thank you.
Feb
17
comment Get the neighboring vertices and incident edges from a vertex in a graph
True. :) +1 Thank you.
Feb
17
comment Get the neighboring vertices and incident edges from a vertex in a graph
yes, NeighborhoodVertices[g, 4, 1] can also get the same list with shorter typing. :)
Feb
6
comment Show path with arrows in a matrix
I see. Because there is no edge between 4 and 6 above. No, I am using V8.0.0.
Feb
6
comment Show path with arrows in a matrix
Looks like I cannot do GridGraph[{5, 5}, VertexSize -> Small, GraphHighlight -> {1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 4, 4 \[UndirectedEdge] 6}] because the last 6 is larger than the dimension 5.
Feb
6
comment Show path with arrows in a matrix
It is very strange here. I can sometimes get the command GridGraph[{5, 5}, VertexSize -> Small, GraphHighlight -> {3 \[UndirectedEdge] 4, 3 \[UndirectedEdge] 2, 2}] executed, but not other times. What is going on here?