You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

matplotlib-cpp 3D示例抛出std::runtime_error异常原因排查

matplotlib-cpp 3D示例运行报错:No axis 核心转储

环境信息

  • 测试库:matplotlib-cpp(使用2023-04-21的commit ef038版本,无正式发布版)
  • 依赖环境:Python 3.10.10、numpy 1.24.2、matplotlib 3.7.1

问题描述

按作者说明编译运行snippet中的surface示例后,触发运行时错误并核心转储。所有2D示例运行正常,但所有3D示例均出现该错误。已尝试GitHub Issues中用户提出的修改方案,均未解决问题。

错误信息

terminate called after throwing an instance of 'std::runtime_error'
what(): No axis
[1] 17416 IOT instruction (core dumped)

GDB回溯信息

(gdb) bt
#0 __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0)
at pthread_kill.c:44
#1 0x00007ffff74a0953 in __pthread_kill_internal (signo=6, threadid=) at pthread_kill.c:78
#2 0x00007ffff7451ea8 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007ffff743b53d in __GI_abort () at abort.c:79
#4 0x00007ffff769a833 in __gnu_cxx::__verbose_terminate_handler ()
at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#5 0x00007ffff76a6d0c in __cxxabiv1::__terminate (handler=)
at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
#6 0x00007ffff76a6d79 in std::terminate () at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
#7 0x00007ffff76a6fdd in __cxxabiv1::__cxa_throw (obj=,
tinfo=0x555555562d60 <typeinfo for std::runtime_error@GLIBCXX_3.4>,
dest=0x7ffff76be480 std::runtime_error::~runtime_error())
at /usr/src/debug/gcc/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98
#8 0x000055555555a369 in matplotlibcpp::plot_surface (x=std::vector of length 41, capacity 64 = {...},
y=std::vector of length 41, capacity 64 = {...}, z=std::vector of length 41, capacity 64 = {...},
keywords=std::map with 0 elements, fig_number=0) at ../matplotlibcpp.h:567
#9 0x00005555555569e7 in main () at surface.cpp:22

内容的提问来源于stack exchange,提问作者Kevin Powell

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 20:27:44