Introduction to Matplotlib

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

Which region did Kujul Kadafsis incorporate into his empire?

  • Kabul and Kashmir (correct)
  • Afghanistan and Pakistan
  • Gandhara and Mathura
  • Peshawar and Kashmir

Who succeeded Kujul Kadafsis?

  • Vima Kadaphises (correct)
  • Ashoka
  • Kanishka
  • Menander

In which year did Kanishka ascend to the throne, marking the start of the Saka era?

  • 128 AD
  • 108 AD
  • 48 AD
  • 78 AD (correct)

Which cities served as the capital for Kanishka's empire?

<p>Peshawar and Mathura (A)</p> Signup and view all the answers

Which regions were included in Kanishka's empire?

<p>Afghanistan, Pakistan, and India (B)</p> Signup and view all the answers

What religious faith did Kanishka follow?

<p>Buddhism (A)</p> Signup and view all the answers

During whose reign was the Fourth Buddhist Council held in Kundalvan (Kashmir)?

<p>Kanishka (B)</p> Signup and view all the answers

Which city did Kanishka establish in Kashmir?

<p>Kanishkapur (C)</p> Signup and view all the answers

What trade route did Kanishka establish control over?

<p>Silk Route (A)</p> Signup and view all the answers

During which phase did cultural development reach its peak under Kanishka?

<p>Post-Mauryan phase (D)</p> Signup and view all the answers

Which art forms did Kanishka patronize and promote?

<p>Gandhara art and Mathura art (A)</p> Signup and view all the answers

Who was the founder of the Kanishka Branch?

<p>Kanishka (A)</p> Signup and view all the answers

What was the religious affiliation of the followers during the Fourth Buddhist Council?

<p>Mahayana Buddhism (D)</p> Signup and view all the answers

How did Kanishka contribute to the cultural landscape during his reign?

<p>Promoting cultural development and patronizing various art forms. (B)</p> Signup and view all the answers

Which empire benefited from increased cultural development during Kanishka's reign?

<p>Kushan Empire (C)</p> Signup and view all the answers

What was a significant outcome of Kanishka controlling the Silk Route?

<p>Increased cultural exchange and economic prosperity (A)</p> Signup and view all the answers

Which aspect of society did Kanishka's patronage of Gandhara and Mathura art influence?

<p>Artistic and cultural expression (D)</p> Signup and view all the answers

What evidence suggests Kanishka's empire stretched across a vast geographic area?

<p>Inclusion of Afghanistan, Pakistan, and India in his domain (D)</p> Signup and view all the answers

How did Kanishka's rule impact the spread of Buddhism?

<p>His support led to the expansion and influence of Buddhism. (A)</p> Signup and view all the answers

How did Kanishka's actions align with the principles of Mahayana Buddhism?

<p>Promoting universal salvation. (B)</p> Signup and view all the answers

Flashcards

Who was Kujul Kadafsis?

Founder of the Kadafsis Branch.

Who was Vim Kadafsis?

Son and successor of Kujul Kadafsis.

Who was Kanishk?

Founder of the Kanishk Branch.

78 AD Significance?

Kanishk ascended to the throne, marking the beginning of the Saka Era.

Signup and view all the flashcards

Kanishk's Capitals?

Peshawar and Mathura.

Signup and view all the flashcards

Extent of Kanishk's Empire?

Afghanistan, Pakistan, and India.

Signup and view all the flashcards

Kanishk's Religious Affiliation?

A follower of Mahayana Buddhism.

Signup and view all the flashcards

Kundalvan Significance?

The Fourth Buddhist Council was held in Kundalvan, Kashmir.

Signup and view all the flashcards

Kanishk's City?

He established the city of 'Kanishkpur'.

Signup and view all the flashcards

Kanishk's Control?

He established control over the Silk Route.

Signup and view all the flashcards

Kanishk's Era?

Significant cultural developments.

Signup and view all the flashcards

Kanishk's Patronage?

He promoted both Gandhar and Mathura art.

Signup and view all the flashcards

Study Notes

What is Matplotlib?

  • Matplotlib is a Python library used for creating static, animated, and interactive visualizations.
  • It simplifies common tasks and enables complex customizations.
  • It produces publication-quality plots.
  • Interactive figures allow zooming, panning, and updating.
  • You can customize visual styles and layouts.
  • Provides wide support for file formats.
  • Can be embedded in JupyterLab and graphical user interfaces.
  • Matplotlib supports third-party packages.

Installation

  • To install Matplotlib, use pip: pip install matplotlib.
  • Alternatively, if using conda, use: conda install matplotlib.
  • Import the pyplot module to use Matplotlib in Python: import matplotlib.pyplot as plt.

Basic Plotting

  • Line plots, scatter plots, bar charts, and histograms are among the basic plot types.
  • Use plt.plot(x, y) to create a line plot with specified x and y values.
  • Use plt.scatter(x, y) to create a scatter plot with specified x and y values.
  • Use plt.bar(categories, values) to create a bar chart with specified categories and values.
  • Use plt.hist(data, bins=5) to create a histogram with specified data and bin count.
  • Labels and titles can be added to plots using plt.xlabel, plt.ylabel, and plt.title.
  • Use plt.show() to display the plots.

Customization

  • Plots can be customized with different colors, markers, and line styles.
  • Customize the line plot with plt.plot(x, y, color='red', linestyle='--', marker='o', linewidth=2, markersize=8).
  • Add a legend to differentiate the plots using plt.legend().
  • Implement grid lines using plt.grid(True).

Subplots

  • Multiple plots can be displayed within the same figure using subplots.
  • Use fig, axs = plt.subplots(2, 1) to create a figure and a set of subplots with 2 rows and 1 column.
  • Plot data on specific subplots with axs.plot(x, y1), and set titles with axs.set_title('Subplot 1').
  • Add a title to the entire figure with fig.suptitle('Subplots Example').
  • Use plt.tight_layout() to prevent overlapping.

3D Plotting

  • Matplotlib supports 3D plotting using the mpl_toolkits.mplot3d toolkit.
  • Use fig = plt.figure() and ax = fig.add_subplot(111, projection='3d') to create a 3D subplot.
  • 3D line plots can be created using ax.plot(x, y, z, label='parametric curve').
  • 3D scatter plots can be created using ax.scatter(x, y, z, c='r', marker='o').
  • Set axis labels using ax.set_xlabel, ax.set_ylabel, and ax.set_zlabel.
  • Set the title with ax.set_title('3D Line Plot').

Saving Plots

  • Plots can be saved to a file using plt.savefig('filename.png or other extension').

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team
Use Quizgecko on...
Browser
Browser