-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Importing pyplot messes with command line argument parsing #1986
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
Comments
The general recommendation is to parse all of your commandline arguments before importing matplotlib. |
That would be news to me, and I think quite unintuitive and impractical as Personally, I think we ought to embrace the logging framework and abolish |
@WeatherGod: Sure, as a long term plan, we should reduce the commandline handling. Note, however, it isn't just for logging that mpl uses commandline flags. It also can be used to set the backend (which I personally use all the time). |
@mdboom: Would it be possible to put that recommendation somewhere prominently? I've never heard of it before, and I couldn't find it in e.g. http://matplotlib.org/users/pyplot_tutorial.html either. |
Yeah -- there isn't even a good place that documents what the commandline arguments are (it's sort of touched on in the FAQ). I'm all for adding more info about this -- I'm not sure the pyplot tutorial is the right place. This is more about embedding matplotlib within a larger application. |
I would argue that even controlling the backend selection should be done by I might be able to prototype such a argument. |
On 2013/05/08 8:03 AM, Benjamin Root wrote:
I agree. Although it can be convenient, it seems like fundamentally bad |
Ok, here is a quick go at it:
|
Should this fall under the color overhaul 2.0 breaking changes? I am -0.5, am flagging it for discussion. |
It seems like this needs to go through a deprecation cycle, unfortunately. Maybe the thing to do right away is add some documentation, including a warning that it will go away. |
This can no longer be reproduced, even on mpl 1.3.1, based on testing by @tacaswell. Evidently it was fixed some time in the misty past. |
I have this issue with matplotlib 3.1.0 on python3. And you can imagine it takes quite a while until you recognize the problem is in a library which randomely decides to remove your input parameters! |
There is no manipulation of |
Yes you are right probably on python2
The result is different between python2 and python3
and it only happens for "--name" input argument
my current versions of matplotlib:
|
Consider this:
Removing the
import matplotlib.pyplot as plt
line gives the correct output,The text was updated successfully, but these errors were encountered: