0
0
Matplotlibdata~10 mins

Rcparams for global defaults in Matplotlib - Interactive Code Practice

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

Complete the code to import the module used to set global plotting defaults.

Matplotlib
import [1] as mpl
Drag options to blanks, or click blank then click option'
Anumpy
Bseaborn
Cpandas
Dmatplotlib
Attempts:
3 left
💡 Hint
Common Mistakes
Importing numpy or pandas instead of matplotlib.
Forgetting to alias matplotlib as mpl.
2fill in blank
medium

Complete the code to set the default figure size globally using rcParams.

Matplotlib
mpl.rcParams['figure.[1]'] = (10, 6)
Drag options to blanks, or click blank then click option'
Adpi
Btitle
Cfigsize
Dsize
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'figure.dpi' instead of 'figure.figsize'.
Using 'figure.size' which is not a valid rcParam.
3fill in blank
hard

Fix the error in the code to set the default font size globally.

Matplotlib
mpl.rcParams['font.[1]'] = 14
Drag options to blanks, or click blank then click option'
Aweight
Bsize
Cfamily
Dstyle
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'font.weight' or 'font.family' instead of 'font.size'.
Trying to set font size with an invalid key.
4fill in blank
hard

Fill both blanks to set the default line width and color globally.

Matplotlib
mpl.rcParams['lines.[1]'] = 2
mpl.rcParams['lines.[2]'] = 'red'
Drag options to blanks, or click blank then click option'
Alinewidth
Blinestyle
Ccolor
Dmarker
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'linestyle' instead of 'linewidth' for width.
Using 'marker' instead of 'color' for line color.
5fill in blank
hard

Fill all three blanks to create a dictionary of rcParams for font family, axes title size, and grid visibility.

Matplotlib
custom_rc = {
    'font.[1]': 'serif',
    'axes.titlesize': [2],
    'axes.[3]': True
}
Drag options to blanks, or click blank then click option'
Afamily
B14
Cgrid
Dlabelsize
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'font.size' instead of 'font.family'.
Using 'axes.labelsize' instead of 'axes.titlesize'.
Using 'axes.grid' with a string instead of boolean.