{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Zorder Demo\n\n\nThe drawing order of artists is determined by their ``zorder`` attribute, which\nis a floating point number. Artists with higher ``zorder`` are drawn on top.\nYou can change the order for individual artists by setting their ``zorder``.\nThe default value depends on the type of the Artist:\n\n================================================================ =======\nArtist Z-order\n================================================================ =======\nImages (`.AxesImage`, `.FigureImage`, `.BboxImage`) 0\n`.Patch`, `.PatchCollection` 1\n`.Line2D`, `.LineCollection` (including minor ticks, grid lines) 2\nMajor ticks 2.01\n`.Text` (including axes labels and titles) 3\n`.Legend` 5\n================================================================ =======\n\nAny call to a plotting method can set a value for the zorder of that particular\nitem explicitly.\n\n
`~.axes.Axes.set_axisbelow` and :rc:`axes.axisbelow` can further modify the\n zorder of ticks and grid lines.