使用wxMathPlot绘制二维坐标曲线图

使用wxMathPlot绘制二维坐标曲线图
工作环境:wxWidgets-3.0.4, codeblcok17.12,win10
第一步:先下载wxMathPlot的wxMathPlot-0.1.2.tar.gz(https://sourceforge.net/projects/wxmathplot/files/),通常只需要使用2个文件:wxmathplot.cpp 和 wxmathplot.h。
第二步:使用codeblock建立一个wxWidgets的empty project。
第三步:使用mp1.cpp 这个例子,将3个文件wxmathplot.cpp 、wxmathplot.h和mp1.cpp
拷贝到project下面,然后将3个文件添加到project。
第四步:修改wxmathplot.cpp内容,将所有的"::wxLogError" 改为 “wxLogError”.否则编译的时候会出现错误:

In file included from /home/wo/Desktop/install/wxMathPlot/wxMathPlot-0.1.2/mathplot.cpp:36:0:
/home/wo/Desktop/install/wxMathPlot/wxMathPlot-0.1.2/mathplot.cpp: In member function 'void mpMovableObject::ShapeUpdated()':
/usr/include/wx-3.0/wx/log.h:1361:5: error: expected id-expression before 'for'
     for ( bool loopvar = false;    
                                       \

编译后运行,就看到演示代码的结果了。
使用wxMathPlot绘制二维坐标曲线图_第1张图片

你可能感兴趣的:(c++)