Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6575991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:27:18+00:00 2026-05-25T15:27:18+00:00

Warning! I posted the question when Mathematica v 8.0 was the coolest kid. The

  • 0

Warning! I posted the question when Mathematica v 8.0 was the coolest kid. The bug has been solved as of version 9.0.1

The help for EdgeLabels states:

enter image description here

However:

CompleteGraph[4,
 EdgeWeight -> Range@6,
 VertexShapeFunction -> "Name",
 EdgeLabels -> "EdgeWeight"]

Results in:

enter image description here

So, no Edge Labels … I guess it is a bug.

I used a nasty construct like:

adj = {{\[Infinity], 1, 1, 1, 1}, {1, \[Infinity], 2, 2, 2}, 
       {1, 2, \[Infinity], 2, 2}, {1, 2, 2, \[Infinity], 2}, 
       {1, 2, 2, 2, \[Infinity]}};

WeightedAdjacencyGraph[adj,
    VertexShapeFunction -> "Name", 
    EdgeLabels -> 
     MapThread[Rule,{EdgeList@#,AbsoluteOptions[#, EdgeWeight]/.{_ -> x_}-> x}], 
    GraphHighlight -> FindEdgeCover[#]]  
                                        &@ WeightedAdjacencyGraph[adj]

enter image description here

Better ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:27:19+00:00Added an answer on May 25, 2026 at 3:27 pm

    For a regular GraphPlot, you will need a slightly more complicated solution using EdgeRenderingFunction (documentation). Suppose you have an adjacency matrix where the elements are also the (directional) weights.

    lilnums = {{0, 2., 1., 3., 0, 6.}, {0, 0, 1., 2., 0, 0}, {1., 8., 0, 2., 0, 
     2.}, {10., 13., 7., 0, 0, 10.}, {0, 0, 0, 0, 0, 0}, {4., 1., 1., 2.,
     2., 0}}
    

    Here are some labels for the vertices, supposing you are drawing network diagrams for international inter-bank exposures (the original has a lot more countries!).

    names = {"AT", "AU", "CA", "CH", "CL", "ES"}
    

    The following does what you need. The tricks are the reference back to the adjacency matrix using the parts of #2 inside the part specification, to reference the correct elements of nums, and the Mean[#1] to locate the label at the midpoint of the edge. The slot #1 seems to hold the coordinates of the vertices.

    GraphPlot[lilnums, DirectedEdges -> True, 
     VertexRenderingFunction -> ({White, EdgeForm[Black], Disk[#, .04], 
     Black, Text[names[[#2]], #1]} &), 
     EdgeRenderingFunction -> ({AbsoluteThickness[2], Red, 
     Arrowheads[0.02], Arrow[#1, 0.05], Black, 
     Text[Round@ Abs[(lilnums[[#2[[1]], #2[[2]]]] + 
       lilnums[[#2[[2]], #2[[1]]]])], Mean[#1], 
      Background -> Yellow]} &), VertexLabeling -> True, 
     ImageSize -> 600,  
      PlotLabel -> Style["Plot Label", Bold, 14, FontFamily -> "Arial"]]
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I could imagine this question has already been asked, but I actually could not
I posted a question last night about Java Reflection and am discovering compiler warnings
Warning - I am very new to NHibernate. I know this question seems simple
WARNING: I have been learning Python for all of 10 minutes so apologies for
I posted a question awhile ago asking how I could limit the rate at
So, I previously asked this question: Can someone help me compare using F# over
I posted this question and have a freshly minted code signing cert from Thawte.
Why isn't this XHTML valid? The HTML: <h2>earthquake warning <span>Posted 03/11/2009 at 2.05pm</span></h2> The
I posted earlier ( OOP in C, implementation and a bug ) about my
I've already posted this question on the authors website , but I thought I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.