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

Cycler passed as string for rc · Issue #7219 · matplotlib/matplotlib · GitHub

Repository navigation

Cycler passed as string for rc #7219

Closed
Closed

Description

Hello, I think I have found a bug with cycler when It is passed as a string for rc parameters. Here is example code I have

import pylab as plt

### WORKS
plt.rc("axes",prop_cycle=plt.cycler('linestyle', ['-', (0,(5,5))]) )
plt.plot([1,2])
plt.plot([1,4])
plt.show()

### ERROR

plt.rc("axes",prop_cycle="cycler('linestyle', ['-', (0,(5,5))])" )
plt.plot([1,2])
plt.plot([1,4])
plt.show()

When I run this code the first part works but the second part produces a long error - error.txt. I am using Ubuntu 16.04 and upgraded matplotlib to 1.5.3 with pip today.

Activity

  1. added this to the milestone on Oct 4, 2016
  2. tacaswell commented on Oct 4, 2016

    Member

    I hope you encountered this by reading in a style file / putting this in matplotlibrc.

    It looks like the validation/parsing on this is not good enough. This particular case is a bit tricky as the linestyle can be a list of strings so treating this as a list of strings seems reasonable.

  3. added
    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
    on Oct 4, 2016
  4. WeatherGod commented on Oct 5, 2016

    Member

    I wonder if the same problem would happen if the order of the linestyles
    were reversed? Also, is this happening on master as well?

    On Tue, Oct 4, 2016 at 7:26 PM, Thomas A Caswell notifications@github.com
    wrote:

    I hope you encountered this by reading in a style file / putting this in
    matplotlibrc.

    It looks like the validation/parsing on this is not good enough. This
    particular case is a bit tricky as the linestyle can be a list of
    strings so treating this as a list of strings seems reasonable.

    —
    You are receiving this because you are subscribed to this thread.
    Reply to this email directly, view it on GitHub
    #7219 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AARy-C-Y7lAz2EPP7Gcjnd_Bf8RFaKhGks5qwuCMgaJpZM4KOLNd
    .

  5. anntzer commented on Oct 5, 2016

    Contributor

    I'm going to take advantage of this issue to readvertise my suggestion of using a python source file for matplotlibrc (#7089 (comment))...

  6. WeatherGod commented on Oct 5, 2016

    Member

    This doesn't have anything to do with rc files. This is passing arguments
    to plt.rc().

    On Wed, Oct 5, 2016 at 2:52 PM, Antony Lee notifications@github.com wrote:

    I'm going to take advantage of this issue to readvertise my suggestion of
    using a python source file for matplotlibrc (#7089 (comment)
    #7089 (comment)
    )...

    —
    You are receiving this because you commented.
    Reply to this email directly, view it on GitHub
    #7219 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AARy-FyIZj2AXJuTV8zG18c7Ba7qm8hbks5qw_H5gaJpZM4KOLNd
    .

  7. WeatherGod commented on Oct 5, 2016

    Member

    as a matter of fact, this is actually an argument against using python
    source files for matplotlibrc's because we still need to support taking
    string inputs into functions like plt.rc(), so we would need to keep our
    parsing logic anyway, so there is very little gain.

    On Wed, Oct 5, 2016 at 3:08 PM, Benjamin Root ben.v.root@gmail.com wrote:

    This doesn't have anything to do with rc files. This is passing arguments
    to plt.rc().

    On Wed, Oct 5, 2016 at 2:52 PM, Antony Lee notifications@github.com
    wrote:

    I'm going to take advantage of this issue to readvertise my suggestion of
    using a python source file for matplotlibrc (#7089 (comment)
    #7089 (comment)
    )...

    —
    You are receiving this because you commented.
    Reply to this email directly, view it on GitHub
    #7219 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AARy-FyIZj2AXJuTV8zG18c7Ba7qm8hbks5qw_H5gaJpZM4KOLNd
    .

  8. anntzer commented on Oct 5, 2016

    Contributor

    I thought that the whole reason for allowing string inputs in plt.rc was that the parsers are already there for handling matplotlibrc; if matplotlibrc is a python file then likewise plt.rc should likewise discard support for string inputs. Or, if we really want to keep support for this, we should just eval such inputs.

  9. modified the milestones: , on May 3, 2017
  10. modified the milestones: , on Oct 9, 2017
  11. github-actions commented on Mar 31, 2023

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  12. anntzer commented on Mar 31, 2023

    Contributor

    This has actually been fixed as of master, afaict.

  13. removed this from the future releases milestone on Mar 31, 2023
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

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesstatus: inactiveMarked by the “Stale” Github Actiontopic: rcparams

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL