البرمجة

عرض الصور في IPython Notebook

To display the image correctly in your IPython notebook using the skimage library, you can use the following code:

python
from skimage import data, io import matplotlib.pyplot as plt coins = data.coins() plt.imshow(coins, cmap='gray') plt.axis('off') # Turn off axes numbers plt.show()

This code will display the image without the string and will show it directly below the code cell. The cmap='gray' argument is used to display the image in grayscale, similar to the example image you provided. The plt.axis('off') command is used to turn off the axis numbers (ticks) for a cleaner display.

المزيد من المعلومات

لعرض الصورة بشكل صحيح في دفتر Jupyter الخاص بك باستخدام مكتبة skimage ، يمكنك اتباع الخطوات التالية:

  1. استيراد الوحدات اللازمة:
python
from skimage import data, io import matplotlib.pyplot as plt
  1. استخدام io.imshow() لعرض الصورة:
python
coins = data.coins() io.imshow(coins)
  1. عرض الصورة باستخدام plt.show():
python
plt.show()

هذه الخطوات يجب أن تظهر الصورة بشكل صحيح تحت خلية الكود في دفتر Jupyter الخاص بك.

مقالات ذات صلة

زر الذهاب إلى الأعلى

هذا المحتوى محمي من النسخ لمشاركته يرجى استعمال أزرار المشاركة السريعة أو تسخ الرابط !!