我如何制作图的片段集合。

bfmplot的Python项目详细描述


为了让我的生活更轻松的情节片段集。名字是 向伟大的Burkhard Bunk致敬。

安装

克隆此存储库

git clone git@github.com:benmaier/bfmplot.git

作为开发版本安装(这样就不必重新安装 更新存储库后)

pip install -e ./bfmplot --no-binary :all:
cd bfmplot; make

或者,正常安装

pip install ./bfmplot
cd bfmplot; make install

示例

第一个例子

frombfmplotimportplimportbfmplotasbpimportnumpyasnpdefsin_test(n=8,text_position='start'):# new figure in the golden ratiopl.figure(figsize=bp.golden_ratio(5))x=np.linspace(0,5*np.pi,100)# plot several functions with different markersforiinrange(n):pl.plot(x,1-np.sin(x[::-1]/np.sqrt(i+1)),marker=bp.markers[i],mfc='w',label='$i=%d$'%i)# remove right and top axisbp.strip_axis(pl.gca())# order legend items to align to the rightleg=pl.legend()bp.align_legend_right(leg)# draw an arrowbp.arrow(pl.gca(),r'$i$',(6,0.8),(3,1.8),text_position=text_position)pl.xlabel('this is the x-label')pl.ylabel('this is the y-label')pl.gcf().tight_layout()sin_test(n=4,text_position='start')pl.show()

one

颜色

forcolors,nameinzip([bp.mpl_default_colors,bp.new_colors,bp.brewer_qualitative,bp.cccs_colors,bp.get_cividis_colors(8),],['bfmplot.mpl_default_colors','bfmplot.new_colors','bfmplot.brewer_qualitative','bfmplot.cccs_colors','bfmplot.get_cividis_colors(8)',],):bp.set_color_cycle(colors)sin_test(n=8,text_position='start')

image1image2image3image4image5

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

推荐PyPI第三方库


热门话题
在reducer中迭代自定义可写组件时出现java问题   属性文件中属性的java命名约定   任务链关闭的java Executor服务   java从Eclipse中的字段生成多个构造函数   java通过继承读取Json   java在不知道密钥的情况下解析json   java camel cxf如何在电子邮件中发送soap请求响应   java程序似乎跳过了if语句的一部分,在移回正确位置之前先移到else语句   测试简单的Java加密/解密inputFileName不存在   java从Jenkins REST API获取所有作业的所有构建的构建细节   java基本包装器和静态“类型”类对象   在WebSphere8.5上部署java代码   java对象相等(对象引用“=”)   java MongoDB整型字段到枚举的转换   每次我重新导入gradle时,IntelliJ都会不断重置Java设置   类型使用键或索引从Java中的数据类型检索值   在Java的列表接口中需要listIterator()和iterator()是什么?