Es fiel mir schwer, ImageMagick und PythonMagick zu installieren, die Bibliotheken, die zum Erstellen animierter GIFs in Python benötigt werden.
So was
So was
Sie können so etwas generieren.
sudo dscl . -append /Groups/Rad GroupMembership <Benutzername>
sudo chmod -R g+w /usr/local/include/
sudo chmod -R g+w /usr/local/share/man/man5
sudo chmod -R g+w /usr/local/lib/
brew link libpng
brew install imagemagick
brew install boost
brew install boost-python
sudo chmod -R g+w /usr/local/share/info
brew link libtool
Laden Sie Python Magick herunter http://www.imagemagick.org/download/python/
cd /path/to/PythonMagick-0.9.12
./configure
make
Ich bekomme eine Fehlermeldung. .. ..
error
CXXLD _PythonMagick.la
clang: warning: argument unused during compilation: '-pthread'
ld: warning: directory not found for option '-L/usr/local/Cellar/freetype/2.6/lib'
Als ich es nachgeschlagen habe, in meiner Umgebung
/usr/local/Cellar/freetype/2.6_1/lib/
Scheint der richtige Weg zu sein.
Suchen Sie die zu ändernde Datei.
find ./ -type f -print | xargs grep 'freetype' -n
Da es direkt unter / path / to / PythonMagick-0.9.12
war,
vi _PythonMagick.la
Also habe ich den Pfad korrigiert. nimm das Herz,
make
sudo make install
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation as ani
plt.style.use('ggplot')
num_frame = 80.
x_range= 7
def animate(nframe):
global num_frame
plt.clf()
a = ((5*nframe/num_frame) -.5) * np.pi
x = np.linspace(-x_range, x_range, 200)
y = np.sin(x+a)
plt.xlim(-x_range, x_range)
plt.ylim(-1.1,1.1)
plt.plot(x, y, c="b")
fig = plt.figure(figsize=(12,5))
anim = ani.FuncAnimation(fig, animate, frames=int(num_frame))
anim.save('anim_test.gif', writer='imagemagick', fps=5, dpi=64)
Es ist fertig!
Recommended Posts