数据可视化处理语言中的图形如何命名?

How to give name to a figure in processing language of data visualisation?

我正在使用处理语言来可视化 A* 算法(以找到起点和终点城市之间的最佳路径)。

每个城市都显示为一个点,但我想给它命名,但找不到任何方法。

此外,我想为名称设置字体大小、颜色、字体粗细等样式。

请告诉我。

编辑:
下面是一个代码片段,我在字符串 currCity 中有城市名称,它在 Double 值列表中的位置(它只有 2 个值,一个是 x' 轴,另一个是 y' 轴)。通过使用此位置,我可以绘制该点但不知道如何命名。

基本上我有一张所有城市的地图,其中键是城市名称(在我的例子中是唯一的),值是坐标列表。我正在遍历每个键

String currCity = currEntry.getKey();
List<Double> currLocationList = currEntry.getValue(); 
stroke(255);
ellipse(currLocationList.get(0).intValue(), currLocationList.get(1).intValue(), w, h);
//w, h is width and height of circle (I am setting as just 1 to draw a point) 

此类问题最好由 the Processing reference 回答。

I want to name it and I couldn't find any way to do so.

您可以使用 text() 函数显示文本。

Also, I would like to set style for name as in font-size, color, font-weight.

查看 textSize() 函数、fill()stroke() 函数以及各种 Typography 函数。