[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] postscript and label.family

From: Vincent Matossian
Subject: Re: [igraph] postscript and label.family
Date: Fri, 6 Jul 2007 18:54:55 -0400

I had completely missed that, thanks for the quick fix Gabor!   :)

I'm trying to create a legend with something similar to colorkey in heat/level/contour plots, but with the colors representing colors as  properties of nodes in the graph. Does anyone have an idea how it can be done in R?


On 7/6/07, Gabor Csardi <address@hidden> wrote:
Vincent, you need to include the fonts to be used in the 'postscript'
call, otherwise only 'Helvetica' is available. Unfortunately for igraph
the default is 'serif', hence the error message. Here is how to do it,
the trick is the 'fonts' argument of 'postscript':

g <- graph.ring(10)
E(g)$label <- sample(letters, ecount(g))

postscript("/tmp/test.eps", fonts=c("serif", "Palatino"))
plot(g, layout=layout.circle, vertex.label.family="serif",
     edge.label.family="Palatino", vertex.label.cex=2,

Of course in this case 'vertex.label.family ' could be omitted as
the default is 'serif' anyway.

Another solution would be to set the default font to 'serif' with


On Fri, Jul 06, 2007 at 05:50:36PM -0400, Vincent Matossian wrote:
>   Hi,
> I'm experiencing this error when saving a plot as postscript:
> Error in text.default(x, y, labels = labels, col = label.color, family =
> label.family,  :
>         family 'serif' not included in PostScript device
> Even though names(postscriptFonts()) shows that "serif" is included first!
> > names(postscriptFonts())
>  [1] "serif"                "sans"                 "mono"
> "symbol"
>  [5] "AvantGarde"           "Bookman"              "Courier"
> "Helvetica"
>  [9] "Helvetica-Narrow"     "NewCenturySchoolbook" "Palatino"
> "Times"
> [13] "URWGothic"            "URWBookman"           "NimbusMon"
> "NimbusSan"
> [17] "URWHelvetica"         "NimbusSanCond"        "CenturySch"
> "URWPalladio"
> [21] "NimbusRom"            "URWTimes"             "ComputerModern"
> "ComputerModernItalic"
> [25] "Japan1"               "Japan1HeiMin"         "Japan1GothicBBB"
> "Japan1Ryumin"
> [29] "Korea1"               "Korea1deb"            "CNS1"
> "GB1"
> I'm only having this problem using igraph but it might not be related to it, so
> I'm sorry if this is actually off topic.
> But if anyone has had this problem or how I could fix it that would be great
> because this is preventing me from saving to .ps
> Thanks!
> Vincent
> PS (the other one): this is igraph 5.0 and R 2.5.0. same problem on windows and
> mac.

> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help

Csardi Gabor <address@hidden>    MTA RMKI, ELTE TTK

igraph-help mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]