Skip to content

Issue #6967 - symlog + minor ticks = exception #8353

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

Closed
wants to merge 10,000 commits into from
Closed

Issue #6967 - symlog + minor ticks = exception #8353

wants to merge 10,000 commits into from

Conversation

ColinDruery
Copy link
Contributor

calling minorticks_on() with symlog previously caused an exception. This fix passes a transform object into the SymmetricalLogLocator instead of a float type. Appended tests to verify minorticks_on() works with various combinations of log and symlog. I believe this should solve the issue described in #6967.

anntzer and others added 30 commits February 19, 2017 00:51
Named Matplotlib module in windows instructions
Pytest documentation + build tweaks
Conflicts:
   .travis.yml
    keep head version of test matrx

   examples/pylab_examples/matshow.py
    whitespace

   lib/matplotlib/__init__.py
    conflicts in list of tests, kept master version

   lib/matplotlib/cm.py
    conflicts in building reveresd color maps
    c2daee2 vs
    14b47ba Kept version on
    master, the deprecation warnings only show up in
    `__getitem__`, not `items`.

    Kept master version

   lib/matplotlib/markers.py
    98a9347 and
    4b7ad54 which are a commit
    and it's backport.  Kept the mater version.

   lib/matplotlib/tests/test_axes.py
    - keep test added in 2.0.x, but remove @cleanup, already used bare asserts
    - discard nose file runner

   lib/matplotlib/tests/test_image.py
    - convert added test to pytest
    - discard nose file runner

   lib/matplotlib/tests/test_marker.py
    - convert added test to pytest
    - discard nose file runner

   lib/matplotlib/tests/test_patches.py
    - discard nose file runner
    - keep tests from master and 2.0.x

   lib/matplotlib/tests/test_scale.py
    keep master version (conflicts due to porting the backport
    of test to nose), same as conflicts in scale.py
Simplify the implementation of various methods.  Note the switch to
`np.min` rather than `min`, which avoids silently dropping `nan`s.

Switch to modern property declarations.  Cleanup some docstrings.
FIX label vertical alignment can now be specified
This makes the result a bit more reproducable and comparable.
Travis may or may not have a browser installed, but AppVeyor definitely
does, so this saves a tiny bit of processing power per run.
Before the patch,
```
ec = plt.errorbar([1, 2], [3, 4], [5, 6], capsize=2, fmt="none")
print(ec.get_children())
```
would print `None` (corresponding to the "not drawn" line connecting the
data points), two `Line2D` and one `LineCollection`.

This patch drops the `None` out, as it is arguably not a child of the
Container.  (It is still possible to access the individual members of
the Container by unpacking it as a tuple.)

Also reformat an overly indented piece of code in the vicinity.
Deprecate matplotlib.tests.assert_str_equal.
NelleV and others added 16 commits March 17, 2017 09:51
Use neutral pronoun in docs.
DOC added titles to the rest of the 3D plots
…ainment

Fix containment test with nonlinear transforms.
[MRG+2] DOC api's transition to sphinx-gallery is now complete
Don't index into __builtins__ (not supported by PyPy).
Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

You appear to have not set your email address before committing. It is some virtual machine name instead of your email address.

# Test for x and y axes both symlog
def test_minorticks_symlog():
plt.plot([1,2,3,4])
ax = plt.gca()
Copy link
Member

Choose a reason for hiding this comment

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

Better to use plt.subplots.

ax.set_xscale('symlog')
ax.set_yscale('log')
ax.minorticks_on()

Copy link
Member

Choose a reason for hiding this comment

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

Remove whitespace.

@phobson
Copy link
Member

phobson commented Mar 21, 2017

This looks good to me.

Totally optional, but if you're going to fix the first two commits, might I recommend also parametrizing your tests. So instead of the four tests you currently have, I would use one test like this:

@pytest.mark.parametrize('xscale', ['symlog', 'log'])
@pytest.mark.parametrize('yscale', ['symlog', 'log'])
def test_minorticks_on(xscale, yscale):
    ax = plt.subplot(111)
    ax.plot([1, 2, 3, 4])  # note that I'm plotting with `ax`, not `plt`
    ax.set_xscale(xscale)
    ax.set_yscale(yscale)
    ax.minorticks_on()

@QuLogic
Copy link
Member

QuLogic commented Mar 23, 2017

Can you fix the email on the first two commits? There's a script in GitHub's help for that. In step 5, make sure that you've only changed these 6 commits from this branch.

@ColinDruery
Copy link
Contributor Author

ColinDruery commented Mar 23, 2017

Clearly I've made a mistake while fixing these first 2 commits. I'm going to open a new pull request with the correct information and code.

The new revised pull request can be found here: #8367
Sorry for these issues.

@QuLogic QuLogic added this to the 2.0.1 (next bug fix release) milestone Mar 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.