Skip to content

Legend hatching fixes #8575

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
May 8, 2017
Merged

Legend hatching fixes #8575

merged 3 commits into from
May 8, 2017

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented May 5, 2017

Two fixes for hatching in legends:

  • PolyCollections don't show hatching when the default colour is used. This is because the set edge colour is copied which means the default behaviour of finding the hatch colour from rcParams is not done. Instead copy the "original" edge colour which triggers any other processing when setting the edge colour on the legend patch.
  • Patchs show the wrong colour when an explicit one is set; this is simply because the hatching colour is not copied with other settings.

I added tests for both these types of artists; are there any others that might work differently that should be added?

@QuLogic QuLogic added this to the 2.0.2 (next bug fix release) milestone May 5, 2017
@phobson
Copy link
Member

phobson commented May 5, 2017

This looks good to me. The failure appears to be unrelated, but significant -- perhaps due to the very recent pandas release:

======================================================================
ERROR: matplotlib.tests.test_dates.test_date2num_dst_pandas
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/home/travis/build/matplotlib/matplotlib/lib/matplotlib/tests/test_dates.py", line 457, in test_date2num_dst_pandas
    _test_date2num_dst(pd.date_range, tz_convert)
  File "/home/travis/build/matplotlib/matplotlib/lib/matplotlib/tests/test_dates.py", line 374, in _test_date2num_dst
    dt_bxl = tz_convert(dt_utc, BRUSSELS)
  File "/home/travis/build/matplotlib/matplotlib/lib/matplotlib/tests/test_dates.py", line 455, in tz_convert
    return pd.DatetimeIndex.tz_convert(*args).astype(datetime.datetime)
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python3.5/site-packages/pandas/core/indexes/datetimes.py", line 848, in astype
    dtype = pandas_dtype(dtype)
  File "/home/travis/build/matplotlib/matplotlib/venv/lib/python3.5/site-packages/pandas/core/dtypes/common.py", line 1909, in pandas_dtype
    raise TypeError('dtype {0} not understood'.format(dtype))
TypeError: dtype <class 'datetime.datetime'> not understood

----------------------------------------------------------------------
Ran 6209 tests in 469.882s

FAILED (KNOWNFAIL=32, errors=1)
[Inferior 1 (process 19743) exited with code 01]

@tacaswell tacaswell closed this May 7, 2017
@tacaswell tacaswell reopened this May 7, 2017
@tacaswell
Copy link
Member

power cycled to restart tests with b0ca78c on 2.0.x

Failures look related to #8579 (some test, but different trace back).

@tacaswell tacaswell modified the milestones: 2.0.3 (next bug fix release), 2.0.2 (critical bug fixes from 2.0.1) May 7, 2017
@phobson phobson merged commit c192e37 into matplotlib:v2.0.x May 8, 2017
@QuLogic QuLogic deleted the legend-hatching branch May 8, 2017 02:16
@efiring efiring mentioned this pull request May 18, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants