FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Dotted grid lines in v2.0.0b1 · Issue #6515 · matplotlib/matplotlib · GitHub

Repository navigation

Dotted grid lines in v2.0.0b1 #6515

Closed
Closed

Description

After installing v2.0.0b1 into my conda installation (Mac OS X 10.11.5, Python 2.7.11, Anaconda 2.3.0), I noticed a subtle problem with dotted lines in grids. I used the following code to generate the two attached images in v1.5.1 and v2.0.0b1, respectively:

import numpy as np
import matplotlib.pyplot as plt

x = np.array([1, 1, 1, 2, 2, 2, 3, 3, 3])
y = np.array([1, 2, 3, 1, 2, 3, 1, 2, 3])
a = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9])
grid = a.reshape(3, 3)

plt.imshow(grid, extent=(x.min(), x.max(), y.min(), y.max()),interpolation='bicubic')
plt.grid(linestyle='dotted')
plt.show()

If you blow up the new image, alternate dots are linked by a faint gray line, whereas the old dots are clearly separated. Overlaid on some plots, this can make the gridlines look more like dashed lines.

Activity

  1. changed the title [-]Dotted lines in v2.0.0b1[/-] [+]Dotted grid lines in v2.0.0b1[/+] on May 31, 2016
  2. added this to the milestone on Jun 1, 2016
  3. jenshnielsen commented on Jun 1, 2016

    Member

    This is caused by the changes in #5926 where we now changed the default pattern and made them scale with line-width. When the dash/dotted pattern is to small the anti aliasing causes the dots to overlap.

    I still think that scaling with line width is a good idea but perhaps we should make the minimum patterns somewhat larger.

  4. tacaswell commented on Jun 6, 2016

    Member

    The solution is to change the default dot spacing to [1.1, 1.1], PR (plus justification plots) coming.

  5. efiring commented on Jun 6, 2016

    Member

    And change the min value to 2.

  6. tacaswell commented on Jun 19, 2016

    Member

    Under #6547 this code gives

  7. afvincent commented on Jun 19, 2016

    Contributor

    @tacaswell : isn't the patterns a bit flat compared to the aspect ratio of the dotted line style in the picture that you just posted on #6547? If I paste the orange dotted line with lw=1.555… from your example in #6547 over the example showing the new grid lines, here is what I get:

    The orange dots (with ~ default lw) look much more like dots to me than the thiner black ones. I guess this is the result of combining a very thin linewidth value for the grid lines and the new scale floor of lw=2. The black ones may be a bit surprising when one asked for a dotted grid.

    But anyway, for what it's worth, IMO the new grid style is better than before.

    (NB: comparison picture done with Gimp, zoom is 400% and no interpolation was used.)

  8. tacaswell commented on Jul 16, 2016

    Member

    Closing as resolved

    @rayosborn Can you check the 2.0.0b2 to verify that it actually fixes this for you?

  9. rayosborn commented on Jul 18, 2016

    Author

    It looks more consistent, and is certainly distinct from dashed. I'm not sure it really looks dotted to me - more like short-dashed. I think to look truly dotted, you probably have to have larger gaps between each dash, but I guess that is a matter of taste. I can live with this.

  10. fkbreitl commented on Jan 30, 2017

    After testing mpl 2.0.0 I realize the same problem of dotted grid lines not looking dotted as in earlier versions, but dashed.
    Could you please realize a dotted appearance of grid lines and reopen this ticket.
    The current style is not satisfying and a step back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL