Advanced Visualization: Font Properties

This short protocol reviews options for font properties.

Working with Fonts

Cytoscape has several label/font properties that are not shown by default. The full list of relevant label/font properties is accessible under Style→Properties. The following properties are available:

  • Label: defines the label, often used to create a passthrough mapping
  • Label Font Face: this is the font face used
  • Label Font Size: font size, can be used for continuous mapping
  • Label Position: where the font is placed
  • Label Transparency: the transparency of the font
  • Label Width: maximum width of the label, longer labels will be wrapped

Label Mapping

The Label property is most often used to create a passthrough mapping from a network attribute to the node or edge label. In this example, the COMMON attribute is mapped to the Node Label. This example uses the Yeast Perturbation example session file.

  • Click the Map. column of the Label property. Note that there is an existing mapping for COMMON.
  • Under Column, select another attribute to map to, for example a column containing gene or protein symbols.
  • Under Mapping Type, select Passthrough Mapping.
  • Notice that the labels in the network are updated. Switch it back to COMMON.


Label Font Face and Size

The Label Font Face is most commonly used to change the look of all labels for nodes, by changing the default. The Label Font Size is often mapped using the same attribute as the Node Size.

  • Click the Label Font Face property.
  • Click on the Def. column and select a default font for all labels.
  • Click the Label Font Size property.
  • Setup an approprite mapping, for example using Node Degree as the Mapping Column, and defining a Continuous Mapping.


Label Position

The position of the label on the node or edge can be manipulated via the Label Position property, and this is most often used to set the node/edge label position for the whole network by changing the default. In the example below, the node label is placed in the upper right corner of the node.

  • Click the Label Font Face property of the Node tab.
  • Click on the Def. column to bring up the Label Position interface.
  • Drag the rectangle representing the label to the upper right of the main rectangle representing the node. Click OK to apply.


Label Transparency

The Label Transparency is most commonly set for the whole network, meaning the default. In the example below, the transparency for edge lables has been decreased.

  • Click the Label Transparency property.
  • Click on the Def. column and select a new transparency parameter in the interface.