0Pricing
Data Science Academy · درس

المخططات الخطية والعمودية في matplotlib

رسم المخططات مباشرة من DataFrame

المخططات الخطية والعمودية في matplotlib درس مجاني في Data Science Academy على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Data Science Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Data Science Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Pictures Beat Tables

A wall of numbers hides trends. A quick chart reveals them instantly, which is why every analysis ends with a plot. 📊

Import pyplot Once

The drawing engine lives in matplotlib.pyplot, almost always imported as plt. That short alias keeps every plot call tidy.

import matplotlib.pyplot as plt

Line Charts Show Change

Reach for a line chart when something moves over a continuous axis, like sales rising month after month.

plt.plot(months, sales)

Bars Compare Categories

Use a bar chart to compare separate groups side by side, like total sales for each region.

plt.bar(regions, totals)

Plot Straight From pandas

Every Series and DataFrame has a built-in .plot that calls matplotlib for you, so you skip the manual setup.

df["sales"].plot()

Choose the Kind

The pandas plot takes a kind argument. Pass kind="bar" for bars or leave it off for the default line.

df["sales"].plot(kind="bar")

Group Then Plot

A grouped summary plots beautifully because its index becomes the x-axis. Group, aggregate, then chain .plot.

df.groupby("region")["sales"].sum().plot(kind="bar")

Show the Figure

Outside a notebook you must call plt.show to pop the window. In Jupyter the chart appears on its own.

plt.show()

Size It Up

Tiny charts hide detail. Pass figsize as a width and height in inches to give your plot room to breathe.

df["sales"].plot(figsize=(8, 4))

Layer More Lines

Call plt.plot several times before showing and matplotlib stacks each line onto the same axes for easy comparison.

Clear Before You Redraw

Leftover plots can pile up across cells. Start fresh with plt.figure or close old ones so charts do not overlap.

Quick Check

You want to compare total sales across a few regions. Which chart fits best?

Recap: Your First Charts

You can now import plt, draw lines for trends and bars for categories, and plot straight from pandas. Your data has a face now! 🎨

الأسئلة الشائعة

هل درس «المخططات الخطية والعمودية في matplotlib» مجاني؟

نعم — نص درس «المخططات الخطية والعمودية في matplotlib» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Data Science Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Data Science Academy 4 دروس في المجموع.

ماذا ستتعلم في «المخططات الخطية والعمودية في matplotlib»؟

رسم المخططات مباشرة من DataFrame تتمرن على Data Science Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Data Science Academy؟

لا تُشترط خبرة سابقة. Data Science Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.

كم من الوقت يستغرق درس «المخططات الخطية والعمودية في matplotlib»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Data Science Academy هذا؟

نعم. كل درس في Data Science Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. الفرز حسب عمود واحد أو عدة أعمدة
  2. ملخصك الأول باستخدام groupby
  3. المخططات الخطية والعمودية في matplotlib
  4. التسميات والعناوين ووسائل الإيضاح
← العودة إلى Data Science Academy