pyadigraph将您的networkx转换为adigraph乳胶包。

pyadigraph的Python项目详细描述


travissonar_qualitysonar_maintainabilitysonar_coverageMaintainabilitypip

pyadigraph将您的networkx转换为adigraph乳胶包。

用这个包生成的乳胶需要Adigraph (1.7.0+)subfigures包。

安装

安装adigraph后,您可以运行:

pip installed pyadigraph

示例

frompyadigraphimportAdigraphimportnetworkxasnxA=Adigraph(vertices_color_fallback="gray!90",edges_color_fallback="gray!90",sub_caption="My adigraph number {i} of {n}",sub_label="adigraph_{i}_{n}",row_size=1,caption="A graph generated with python and latex.",label="pyadigraph_example")A.add_graph(nx.bipartite.random_graph(4,4,1),vertices_color={0:'red!90',1:'red!90',4:'cyan!90',7:'cyan!90'})A.save("test/result.tex",document=True)

当生成结果时:

\documentclass{report}\usepackage{adigraph}\usepackage{subcaption}\begin{document}\begin{figure}\begin{subfigure}{1.0\textwidth}\NewAdigraph{myAdigraph}{
            0,red!90,:-0.4386601404141742\textwidth,0.2091077552922947\textwidth:;
            1,red!90,:-0.15708496776680972\textwidth,0.09630690244229406\textwidth:;
            2,gray!90,:0.43887677279554366\textwidth,-0.2079924280020609\textwidth:;
            3,gray!90,:0.15678823839504888\textwidth,-0.09746320565948384\textwidth:;
            4,cyan!90,:-0.3736460590634439\textwidth,-0.327631363498189\textwidth:;
            5,gray!90,:0.3735687548614322\textwidth,0.3275275669374224\textwidth:;
            6,gray!90,:-0.042735184609099336\textwidth,-0.4998552275122768\textwidth:;
            7,cyan!90,:0.0428925858015027\textwidth,0.5\textwidth:;
        }{
            0,4,gray!90,::;
            0,5,gray!90,::;
            0,6,gray!90,::;
            0,7,gray!90,::;
            1,4,gray!90,::;
            1,5,gray!90,::;
            1,6,gray!90,::;
            1,7,gray!90,::;
            2,4,gray!90,::;
            2,5,gray!90,::;
            2,6,gray!90,::;
            2,7,gray!90,::;
            3,4,gray!90,::;
            3,5,gray!90,::;
            3,6,gray!90,::;
            3,7,gray!90,::;
        }[]
        \myAdigraph{}\caption{My adigraph number 1 of 1}\label{adigraph_1_1}\end{subfigure}\caption{A graph generated with python and latex.}\label{pyadigraph_example}\end{figure}\end{document}

当您在文档中编译此文件时,您将得到:

example

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java gradle无法解析配置的任何依赖项:类路径   来自远程服务的java错误字符串解析   java如何在Tomcat之外运行TomcatSpring/Struts 2Quartz任务?   将Java字节转换为Perl   Java选项:返回值或执行某些操作并继续循环   java如何从对象中获取变量?   postgresql自动部署web服务java和glassfish服务器4.1.1?   使用泛型的java Resteasy重写方法   在另一个用户登录后显示上一个用户的java数据   JSP(Java):编码字节数组并在JavaScript中使用,与C中相同#   Java:如何知道jar在Linux中的位置   java模拟已标记为可访问的私有方法的返回值   java无法理解滚动窗格   java Spring Boot Starter Web依赖项提供缺少工件的错误   java从SQL表创建json文件,然后能够查询该文件   java线程时钟对象   Java实践编程问题   多线程Java GUI未更改   GL30库中不存在intellij idea GLGEnVertexArray()。(JAVA LWJGL)   二进制文件在java中编辑二进制文件