Skip to content

Commit cc60234

Browse files
committed
Add 'edgefix' options, revert default bar edgecolor, update docs
1 parent fb0209b commit cc60234

2 files changed

Lines changed: 213 additions & 192 deletions

File tree

proplot/axes/base.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,16 +405,27 @@
405405
lw, linewidth, c, color : optional
406406
Controls the line width and edge color for both the colorbar
407407
outline and the level dividers.
408-
orientation : {None, 'horizontal', 'vertical'}, optional
409-
The colorbar orientation. By default this depends on the "side" of the subplot
410-
or figure where the colorbar is drawn. Inset colorbars are always horizontal.
408+
%(axes.edgefix)s
411409
rasterize : bool, optional
412410
Whether to rasterize the colorbar solids. The matplotlib default is ``True``
413411
but we change this to :rcraw:`colorbar.rasterize` because rasterization can
414412
cause misalignment between `edges` and the level patches.
413+
orientation : {None, 'horizontal', 'vertical'}, optional
414+
The colorbar orientation. By default this depends on the "side" of the subplot
415+
or figure where the colorbar is drawn. Inset colorbars are always horizontal.
415416
**kwargs
416417
Passed to `~matplotlib.figure.Figure.colorbar`.
417418
"""
419+
_edgefix_docstring = """
420+
edgefix : bool or float, optional
421+
Whether to fix the common issue where white lines appear between
422+
`filled contours <https://stackoverflow.com/q/8263769/4970632>`__
423+
and `filled patches <https://stackoverflow.com/q/8263769/4970632>`__
424+
in saved vector graphics. This can slow down figure rendering. Default
425+
is :rc:`cmap.edgefix`. If ``True``, a default linewidth is used to fix
426+
the edges. If float, this linewidth is used.
427+
"""
428+
docstring._snippet_manager['axes.edgefix'] = _edgefix_docstring
418429
docstring._snippet_manager['axes.colorbar_args'] = _colorbar_args_docstring
419430
docstring._snippet_manager['axes.colorbar_kwargs'] = _colorbar_kwargs_docstring
420431

0 commit comments

Comments
 (0)