栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

gnuplot学习之---[C++语法练习](曲线绘制)

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

gnuplot学习之---[C++语法练习](曲线绘制)

文章目录
    • 参考文章
    • 示例代码

参考文章

在64位Windows的VS软件中使用C/C++调用gnuplot画图

示例代码

按照上述安装参考,进行安装

#include 

void main()
{
	FILE* pipe = _popen("gnuplot", "w");
	if (pipe == NULL)
	{
		//exit(-1);
	}

	fprintf(pipe, "set terminal wxt size 600, 400n");
	fprintf(pipe, "unset bordern");
	fprintf(pipe, "set dummy u, vn");
	fprintf(pipe, "set angles degreesn");
	fprintf(pipe, "set parametricn");
	fprintf(pipe, "set view 60, 136, 1.22, 1.26n");
	fprintf(pipe, "set samples 64, 64n");
	fprintf(pipe, "set isosamples 13, 13n");
	fprintf(pipe, "set mapping sphericaln");
	fprintf(pipe, "set style data linesn");
	fprintf(pipe, "unset xticsn");
	fprintf(pipe, "unset yticsn");
	fprintf(pipe, "unset zticsn");
	fprintf(pipe, "set title 'Labels colored by GeV plotted in spherical coordinate system'n");
	fprintf(pipe, "set urange [ -90.0000 : 90.0000 ] noreverse nowritebackn");
	fprintf(pipe, "set vrange [ 0.00000 : 360.000 ] noreverse nowritebackn");
	fprintf(pipe, "set xrange [ * : * ] noreverse writebackn");
	fprintf(pipe, "set x2range [ * : * ] noreverse writebackn");
	fprintf(pipe, "set yrange [ * : * ] noreverse writebackn");
	fprintf(pipe, "set y2range [ * : * ] noreverse writebackn");
	fprintf(pipe, "set zrange [ * : * ] noreverse writebackn");
	fprintf(pipe, "set cblabel 'GeV'n");
	fprintf(pipe, "set cbrange [ 0.00000 : 8.00000 ] noreverse nowritebackn");
	fprintf(pipe, "set rrange [ * : * ] noreverse writebackn");
	fprintf(pipe, "set colorbox usern");
	fprintf(pipe, "set colorbox vertical origin screen 0.9, 0.2 size screen 0.02, 0.75 front  noinvert bdefaultn");
	fprintf(pipe, "NO_ANIMATION = 1n");
	fprintf(pipe, "splot cos(u)*cos(v),cos(u)*sin(v),sin(u) notitle with lines lt 5, 'world.dat' notitle with lines lt 2, 'srl.dat' using 3:2:(1):1:4 with labels notitle point pt 6 lw .1 left offset 1,0 font ',7' tc paln");
	fprintf(pipe, "pause mousen");
	_pclose(pipe);
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/529398.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号