Issue 1:
Traceback (most recent call last):

File "/home/hsy/wh/license_plate/datasets/ccpd.py", line 6, in

import pycocotools.coco as coco

File "/home/hsy/.local/lib/python3.6/site-packages/pycocotools-2.0-py3.6-linux-x86_64.egg/pycocotools/coco.py", line 49, in

import matplotlib.pyplot as plt

File "/home/hsy/.local/lib/python3.6/site-packages/matplotlib-3.3.0-py3.6-linux-x86_64.egg/matplotlib/pyplot.py", line 43, in

from matplotlib.figure import Figure, figaspect

File "/home/hsy/.local/lib/python3.6/site-packages/matplotlib-3.3.0-py3.6-linux-x86_64.egg/matplotlib/figure.py", line 18, in

from matplotlib import docstring, projections

File "/home/hsy/.local/lib/python3.6/site-packages/matplotlib-3.3.0-py3.6-linux-x86_64.egg/matplotlib/projections/init.py", line 4, in

from mpl_toolkits.mplot3d import Axes3D

File "/home/hsy/anaconda3/envs/tf15_gpu/lib/python3.6/site-packages/mpl_toolkits/mplot3d/init.py", line 1, in

from .axes3d import Axes3D

File "/home/hsy/anaconda3/envs/tf15_gpu/lib/python3.6/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 24, in

import matplotlib.projections as proj

AttributeError: module 'matplotlib' has no attribute 'projections'

What does this question mean？(My matplotlib version is 3.3.0)

Issue 2:
Summary

Currently, when you plot several artists on the same axis and use the pyplot.legend(), the ordering of the entries is somewhat mysterious for the average user, see http://stackoverflow.com/questions/22263807/how-is-order-of-items-in-matplotlib-legend-determined.

Like many of my peers, I use matplotlib to make plots for science publications and regularly want to customize the order of the items in the legend when I polish plots. I argue that this is a common thing to do, and therefore it should be easy to do with the API.

My request is to add a new keyword lorder to artist constructors, similar to zorder. While zorder handles the drawing order, lorder handles the order in which items appear in the legend.

Current state

tacaswell explained on SO that the order of legend items is an implementation detail and that's fine. There are ways to re-order the items, but they are somewhat cumbersome. One recommended way is to use

[...]
handles, labels = axis.get_legend_handles_labels()

and then reorder to your hearts desire. This is ok when you want to reorder based on a rule, but it is not convenient when you want to re-order manually (because you first have to find out what the current order is, unpack the tuples, reorder them, repack them).

The other recommended way is to keep the return values of pyplot

[...]
art1, = pyplot.plot(...)
art2, = pyplot.plot(...)
# I always forget how to do it for errorbar
# art3, = pyplot.errorbar(...) # fails, unpacking works differently here
plt.legend((art1, art2), ("label1", "label2"))

As you can see, I always have trouble remembering how to unpack the return value correctly for stuff other than pyplot.plot(...) so that it works with plt.legend(...). Surely, other users must feel the same way. I would say that this method relies on knowing more about the matplotlib internals than the average user wants to know.

Proposed solution

The user simply specifies the new lorder keyword in calls to pyplot

[...]
pyplot.plot(..., lorder=2, label="second") # appears second in legend
pyplot.plot(..., lorder=3, label="third") # appears third in legend
pyplot.errorbar(..., lorder=1, label="first") # appears first in legend
plt.legend()

This code is rather clear and makes it very easy to specify the ordering of items in the legend. As far as I understand tacaswell, it should be easy to handle internally as well, just make lorder part of the internal sorting criterion.

A more explicit alternative is keyword labelorder instead of the shorter lorder.