PIL -BildgrößenanpassungPython

Python-Programme
Anonymous
 PIL -Bildgrößenanpassung

Post by Anonymous »

Ich möchte die Zeichnung in Matplotlib in Pil wiederholen. Vielleicht ist das Problem, dass mein Datenformat "4,005.4.006" lautet. Wie erstelle ich die gleiche Grafik in Pil? < /P>

Code: Select all

from PIL import Image, ImageDraw
import numpy as np
N = 461
x = np.linspace(0, 4*np.pi, N)
y = np.sin(x)
y=y+50
im = Image.new('L', (N, N))
draw = ImageDraw.Draw(im)
for i in range(len(x)-1):
draw.line((x[i],y[i], x[i+1], y[i+1]),fill='red',width=2)
im.show()
# this is the graphic i want to get
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot(x, y)
plt.show()
Danke im Voraus

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post
  • So ermitteln Sie die Bildgröße (Byte) mithilfe von PIL
    by Guest » » in Python
    0 Replies
    22 Views
    Last post by Guest
  • Kein Modul namens "Pil"
    by Guest » » in Python
    0 Replies
    29 Views
    Last post by Guest
  • Zeichnen Sie ein Rechteck und einen Text mit PIL darin
    by Anonymous » » in Python
    0 Replies
    19 Views
    Last post by Anonymous
  • Text in Pil einwickeln
    by Anonymous » » in Python
    0 Replies
    15 Views
    Last post by Anonymous
  • Pil, wie man die Textgröße in Bezug auf die Größe des Bildes skaliert
    by Anonymous » » in Python
    0 Replies
    14 Views
    Last post by Anonymous