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

changed colorbar outline from a Line2D object to a Polygon object #2352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 29, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 4 doc/api/api_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ original location:
'open-close-high-low' order of quotes, and what the module used and the later
is 'open-high-low-close' order of quotes, which is the standard in finance.

* The artist used to draw the outline of a `colorbar` has been changed
from a `matplotlib.lines.Line2D` to `matplotlib.patches.Polygon`,
thus `colorbar.ColorbarBase.outline` is now a
`matplotlib.patches.Polygon` object.

.. _changes_in_1_3:

Expand Down
10 changes: 6 additions & 4 deletions 10 lib/matplotlib/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import matplotlib.contour as contour
import matplotlib.cm as cm
import matplotlib.gridspec as gridspec
import matplotlib.lines as lines
import matplotlib.patches as mpatches
import matplotlib.path as mpath
import matplotlib.ticker as ticker
Expand Down Expand Up @@ -415,9 +414,12 @@ def _config_axes(self, X, Y):
ax.set_ylim(*ax.dataLim.intervaly)
if self.outline is not None:
self.outline.remove()
self.outline = lines.Line2D(
xy[:, 0], xy[:, 1], color=mpl.rcParams['axes.edgecolor'],
linewidth=mpl.rcParams['axes.linewidth'])
self.outline = mpatches.Polygon(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default zorder is 2 for Line2D and 1 for Patch objects, so maybe the zorder should be explicitly set to 2 here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

xy, edgecolor=mpl.rcParams['axes.edgecolor'],
facecolor='none',
linewidth=mpl.rcParams['axes.linewidth'],
closed=True,
zorder=2)
ax.add_artist(self.outline)
self.outline.set_clip_box(None)
self.outline.set_clip_path(None)
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.