English 中文(简体)
Wolfram 数学图表的色谱
原标题:Coloring edges on graph in Wolfram Mathematica

能否利用彩色功能在Wolframa打上图表的边缘,这取决于对边缘进行协调? 如同在Plot[]使用科罗功能选择。

I have a function specified on the edge of the graph, depending on coordinate at the edge. Is it possible to paint a dencity of this function on the edge? Thanks for responce.

PS:第一种想法——利用Inset[]在 Edge化功能中使用图形色标,但似乎很不自然。 是否有任何简单的方法?

最佳回答

One way to use ColorFunction to color edges in a Graph is:

  ClearAll[colorededge];
  colorededge[pts_, colorfunc_: Function[{x, y}, ColorData["TemperatureMap"][y]]] := 
  ListPlot[pts, Joined -> True, PlotStyle -> Thick, Axes -> False, 
  ColorFunction -> colorfunc, ColorFunctionScaling -> True];
  edgshpfnc = (If[Last[#2] == "B", First@colorededge[#1], 
  First@colorededge[#1, Function[{x, y}, Blend[{Yellow, Red}, x]]]] &);
  Graph[{"A" -> "B", "B" -> "C", "C" -> "A"}, 
  VertexCoordinates -> {"A" -> {0, 0}, "B" -> {1, 1}, "C" -> {2, 0}}, 
  EdgeShapeFunction -> edgshpfnc, VertexLabels -> "Name",  ImagePadding -> 10]

发放

“entergraph

and

 GraphPlot[{"A" -> "B", "B" -> "C", "C" -> "A"},
 EdgeRenderingFunction -> edgshpfnc, VertexLabeling -> True]

发放

“entergraph

问题回答

暂无回答




相关问题
Java: JGraphT: Iterate through nodes

I m trying to iterate through all nodes, so I can print them out for graphviz. What is the best way to do that using the JGraphT library? public static void main(String[] args) { UndirectedGraph&...

Java: Adding nodes to graph bug

Preface: I know that there are high quality graph APIs available. I m interested in writing my own for self-improvement. This is my function to add nodes: public void addNode(Vertex v, ...

Radial plotting algorithm

I have to write an algorithm in AS3.0 that plots the location of points radially. I d like to input a radius and an angle at which the point should be placed. Obviously I remember from geometry ...

Microsoft .Net Chart Control not showing markers

I m using the Microsoft Chart Controls for Microsoft .NET Framework 3.5 and am having a spot of trouble getting Data Markers to show on the image. I m generating the chart at run-time, so can t just ...

3D graphs using pChart

Is there a way to draw a 3D Bar Graph using the pChart library in PHP? I m able to draw a 3D Pie graph but not a line graph. My code looks as follows //The 3D bar graph # // Dataset ...

Finding cycle of 3 nodes ( or triangles) in a graph

I am working with complex networks. I want to find group of nodes which forms a cycle of 3 nodes (or triangles) in a given graph. As my graph contains about million edges, using a simple iterative ...

How to create line chart in iPhone application? [closed]

I am creating a budget application in iPhone, to budget for personal incomes and expenses. Client s need is I want to see line graph (like stock market line report). Red line for (monthly / weekly /...

热门标签