c:c_에_matplotlib_라이브러리_추가해서_그래프_그리기

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
c:c_에_matplotlib_라이브러리_추가해서_그래프_그리기 [2022/01/16 22:07] jonghoonc:c_에_matplotlib_라이브러리_추가해서_그래프_그리기 [2023/09/05 15:46] (current) – external edit 127.0.0.1
Line 5: Line 5:
  
 다음은 간단히 sin 그래프를 그리는 예제코드다. 다음은 간단히 sin 그래프를 그리는 예제코드다.
-<Code:C++>+<Code:C++ | example.cpp> 
 #include <iostream> #include <iostream>
 #include <vector> #include <vector>
Line 30: Line 31:
     }     }
  
-    plt::plot(x,y); +    plt::plot(x,y); //plot the x,y 
-    plt::grid(true); +    plt::grid(true); //show grid 
-    plt::show();+    plt::show(); // show figure
 } }
 </Code> </Code>
 +
 +컴파일할 때는 
 +<Code:Shell>
 +g++ example.cpp -I/usr/include/python3.8 -lpython3.8 -o example
 +</Code>
 +
 +로 하면 된다.
  
 <color #ffffff>.....................................</color> <color #ffffff>.....................................</color>
 {{:c:untitled.png?700|}} {{:c:untitled.png?700|}}
  • c/c_에_matplotlib_라이브러리_추가해서_그래프_그리기.1642338479.txt.gz
  • Last modified: 2023/09/05 15:46
  • (external edit)