AVR

RaspBerry4 matplot 설치

작성자 임베디드코리아 작성일25-11-25 23:01 조회9회 댓글0건
$ sudo apt install python3-matplotlib
$ apt install python3-numpy

----------<가상 환경에서 >-----------------------------------
# Create a virtual environment named 'my_env'
$ python3 -m venv my_env

# Activate the virtual environment
$ source my_env/bin/activate
# Install numpy within the activated virtual environment
$ sudo pip install numpy
$ pip3 install matplotlib
---------------------------------------------------------------

$ cd ~/WORK
$ mkdir Drawnow
$ cd Drawnow
$ w get https://pypi.python.org/packages/source/d/drawnow/drawnow-0.44.tar.gz
$ tar xzf drawnow-0.44.tar.gz
$ cd drawnow-0.44
$ sudo python setup.py install
$ sudo pip install drawnow
-----------------------
$ cd ~WORK
$ mkdir Matplot_examples
$ cd Matplot_examples
$ vi graph.py
import numpy as np
import matplotlib.pyplot as plt
 
num_examples = 50
 X = np.array([np.linspace(-2, 4, num_examples), np.linspace(-6, 6, num_examples)])
plt.figure(figsize=(5,5))
plt.scatter(X[0], X[1])
plt.show()