Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 69decec

Browse filesBrowse files
committed
MNT : tweak how internals of Axes.plot work
The actual processing and artist creation in Axes.plot happens through the `__call__` method on a _process_plot_var_args instance hanging off the Axes object. The _process_plot_var_args knows what axes it is hanging off of and passed that into the Line2D artists as a kwarg at creation time, which sets the axes of the Line2D. The axes of the Line2D is set again during the `Axes.add_line` method. For the most part this is fine, if un-needed, because the axes is the same objects both time it is set. However when using the mpl_toolkit, Axes objects get wrapped in not-strictly-subclassed objects and the Axes object that the _process_plot_var_args object knows about is not the Axes object that add_line is called on which now results in an exception as it is moving artists between axes.
1 parent 394447f commit 69decec
Copy full SHA for 69decec

File tree

1 file changed

+0
-1
lines changed
Filter options

1 file changed

+0
-1
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ def _makeline(self, x, y, kw, kwargs):
237237
# (can't use setdefault because it always evaluates
238238
# its second argument)
239239
seg = mlines.Line2D(x, y,
240-
axes=self.axes,
241240
**kw
242241
)
243242
self.set_lineprops(seg, **kwargs)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.