X Tutup
Skip to content
Closed
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
16 changes: 16 additions & 0 deletions doc/users/whats_new/style_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,19 @@ Legends
data possible.

- The legend now has rounded corners by default.

mplot3d
```````

- mplot3d now obeys some style-related rcParams, rather than using
hard-coded defaults. These include:

- xtick.major.width
- ytick.major.width
- xtick.color
- ytick.color
- axes.linewidth
- axes.edgecolor
- grid.color
- grid.linewidth
- grid.linestyle
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions lib/matplotlib/tests/test_backend_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ def _test_determinism(filename, usetex):
'_test_determinism_save(%r, %r)' % (filename, usetex)],
stderr=STDOUT)
except CalledProcessError as e:
# it's easier to use utf8 and ask for forgiveness than try to figure
# out what the current console has as an encoding :-/
# it's easier to use utf8 and ask for forgiveness than try to
# figure out what the current console has as an encoding :-/
print(e.output.decode(encoding="utf-8", errors="ignore"))
raise e
with open(filename, 'rb') as fd:
Expand Down
24 changes: 19 additions & 5 deletions lib/mpl_toolkits/mplot3d/axis3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from matplotlib import lines as mlines, axis as maxis, \
patches as mpatches
from matplotlib import rcParams
from . import art3d
from . import proj3d

Expand Down Expand Up @@ -83,11 +84,18 @@ def __init__(self, adir, v_intervalx, d_intervalx, axes, *args, **kwargs):
self._axinfo.update({'label' : {'va': 'center',
'ha': 'center'},
'tick' : {'inward_factor': 0.2,
'outward_factor': 0.1},
'axisline': {'linewidth': 0.75,
'color': (0, 0, 0, 1)},
'grid' : {'color': (0.9, 0.9, 0.9, 1),
'linewidth': 1.0},
'outward_factor': 0.1,
'linewidth': rcParams.get(
adir + 'tick.major.width',
rcParams['xtick.major.width']),
'color': rcParams.get(
adir + 'tick.color',
rcParams['xtick.color'])},
'axisline': {'linewidth': rcParams['axes.linewidth'],
'color': rcParams['axes.edgecolor']},
'grid' : {'color': rcParams['grid.color'],
'linewidth': rcParams['grid.linewidth'],
'linestyle': rcParams['grid.linestyle']},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We might need to do a "classic mode" shim here. In v1.5, the grid lines used the linestyle, linewidth, and color that were the defaults for lines, not the defaults for grids. We might need a bunch of ternary statements or just a single if-statement populating this update dictionary. Any new entries should fall back to None so that the old behavior is preserved.

})


Expand Down Expand Up @@ -375,6 +383,10 @@ def draw(self, renderer):
if self.axes._draw_grid:
self.gridlines.set_segments(lines)
self.gridlines.set_color([info['grid']['color']] * len(lines))
self.gridlines.set_linewidth(
[info['grid']['linewidth']] * len(lines))
self.gridlines.set_linestyle(
[info['grid']['linestyle']] * len(lines))
self.gridlines.draw(renderer, project=True)

# Draw ticks
Expand Down Expand Up @@ -414,6 +426,8 @@ def draw(self, renderer):
renderer.M)

tick_update_position(tick, (x1, x2), (y1, y2), (lx, ly))
tick.tick1line.set_linewidth(info['tick']['linewidth'])
tick.tick1line.set_color(info['tick']['color'])
tick.set_label1(label)
tick.set_label2(label)
tick.draw(renderer)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/mpl_toolkits/tests/baseline_images/test_mplot3d/bar3d.pdf
Binary file not shown.
Binary file modified lib/mpl_toolkits/tests/baseline_images/test_mplot3d/bar3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
X Tutup