0
0
Matplotlibdata~10 mins

Installing Matplotlib - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to install Matplotlib using pip.

Matplotlib
pip [1] matplotlib
Drag options to blanks, or click blank then click option'
Ainstall
Bremove
Cupdate
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pip update matplotlib' instead of 'install'.
Typing 'pip remove matplotlib' which deletes the package.
2fill in blank
medium

Complete the code to import Matplotlib's pyplot module.

Matplotlib
import matplotlib.[1] as plt
Drag options to blanks, or click blank then click option'
Apylab
Bpyplot
Cplot
Dmpl
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'import matplotlib.plot as plt' which is incorrect.
Trying to import 'pylab' which is different.
3fill in blank
hard

Fix the error in the code to display a simple plot.

Matplotlib
plt.plot([1, 2, 3], [4, 5, 6])
plt.[1]()
Drag options to blanks, or click blank then click option'
Ashow
Bdisplay
Cdraw
Dplot
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'plt.display()' which does not exist.
Forgetting to call any function to show the plot.
4fill in blank
hard

Fill both blanks to create a virtual environment and activate it.

Matplotlib
python -m [1] env
source env/[2]/activate
Drag options to blanks, or click blank then click option'
Avenv
Bactivate
Cbin
Denv
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'python -m env env' which is incorrect.
Trying to activate with 'source env/activate' missing the 'bin' folder.
5fill in blank
hard

Fill all three blanks to install Matplotlib inside a virtual environment and verify the version.

Matplotlib
source env/bin/activate
pip [1] matplotlib
import matplotlib
print(matplotlib.[2])
print(matplotlib.__[3]__)
Drag options to blanks, or click blank then click option'
Ainstall
Bversion
Cversion__
D__version__
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to print 'matplotlib.version' instead of 'matplotlib.__version__'.
Using 'pip update' instead of 'install'.