我试图可视化一组RDF海龟,并使用以下代码:
!pip install pydotplus
!pip install graphviz
import io
import pydotplus
from IPython.display import display, Image
from rdflib.tools.rdf2dot import rdf2dot
def visualize(g):
stream = io.StringIO()
rdf2dot(g, stream, opts = {display})
dg = pydotplus.graph_from_dot_data(stream.getvalue())
png = dg.create_png()
display(Image(png))
visualize(g)
这里,g是我的rdfgraph
确实创建了一个图像,但它太小了,我不知道如何保存它。有人能帮我吗
可以使用opencv调整图像大小
范例
单击图片以了解大小,因为它似乎无法在浏览器中正确显示
相关问题 更多 >
编程相关推荐