MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How change font size of Graph vertex labels?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117241] Re: How change font size of Graph vertex labels?
  • From: Armand Tamzarian <mike.honeychurch at gmail.com>
  • Date: Sat, 12 Mar 2011 05:10:39 -0500 (EST)
  • References: <ilcqeh$im9$1@smc.vnet.net>

On Mar 11, 8:36 pm, Murray Eisenberg <murrayeisenb... at gmail.com>
wrote:
> I want to make the "Names" labels of vertices in a Graph larger.  The
> "obvious" way...
>
>    Graph[{1, 2, 3},
>       {DirectedEdge[1, 2], DirectedEdge[2, 3], DirectedEdge[3, 1]},
>       {VertexLabels -> {Placed["Name", Center]}, VertexSize -> {Med=
ium},
>       VertexStyle -> {24}}]
>
> ...seems to do nothing. And replacing the option VertexStyle -> {24}
> with the wordier VertexStyle -> {FontSize->24} prevents Mathematica from
> evaluating the Graph expression at all.
>
> (Mathematica 8.0.1)
> --
> Murray Eisenberg                     mur... at math.umas=
s.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower      phone 413 549-1020 (H)
> University of Massachusetts                413 545-2859 (=
W)
> 710 North Pleasant Street            fax   413 545-1801
> Amherst, MA 01003-9305


My previous answer was based on my last usage of graphs which was over
18 months ago with version 7 and it turns out that
VertexRenderingFunction is for GraphPlot not Graph. Not immediately
clear why two separate functions,GraphPlot and Graph, are needed and
when you use one or the other, but I don't use graphs so haven't read
up on it.

Looks like some nice new features in 8. Right click on a graph to make
many changes. Shame we do not have this sort of contextual menu driven
editing of plots because I venture to say that the usage of basic
plots (Plot, ListLinePlot ...) would be orders of magnitude greater
than the usage of graphs. But it looks like a step in the right
direction.

For Graph, More Information list VertexLabelStyle, which is what you
need. This is another option without a usage example -- something that
seems to be creeping into Mathematica releases these days.

Graph[{1, 2, 3}, {DirectedEdge[1, 2], DirectedEdge[2, 3],
  DirectedEdge[3, 1]}, {VertexLabels -> {Placed["Name", Center]},
  VertexSize -> {Medium}, VertexLabelStyle -> {24}}]

Graph[{1, 2, 3}, {DirectedEdge[1, 2], DirectedEdge[2, 3],
  DirectedEdge[3, 1]}, {VertexLabels -> {Placed["Name", Center]},
  VertexSize -> {Medium},
  VertexLabelStyle -> Directive[FontFamily -> "Helvetica", 24, Blue]}]


Mike


  • Prev by Date: Re: Set persistent default notebook window size and location
  • Next by Date: Re: VertexWeight not showing in Graph
  • Previous by thread: Re: How change font size of Graph vertex labels?
  • Next by thread: Re: How change font size of Graph vertex labels?