2
$\begingroup$

If I input:

g = {"CompleteBipartite", {2, 3}}; 
{GraphData[g, "LabeledImage"], GraphData[g, "EdgeList"]}

then I can see a graph with its vertices labeled. I want to see the edges labeled.

$\endgroup$
1
$\begingroup$

You can use the property "LabeledGraph" and wrap the output with Graph and add the desired options:

Graph[GraphData[{"CompleteBipartite", {2, 3}}, "LabeledGraph"], 
 EdgeLabels -> Placed[Automatic, .7]]

enter image description here

Note: The property "LabeledGraph" is not listed in GraphData["Properties"]:

MemberQ[GraphData["Properties"], "LabeledGraph"]

False

$\endgroup$
3
$\begingroup$

You are probably better off controlling the output Graph object directly. Note how to place labels so they do not overlap with Placed. Read up on docs.

SetProperty[
    GraphData[{"CompleteBipartite", {2, 3}}],
{VertexLabels->Automatic,
EdgeLabels->Placed[Automatic,.7]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.