Addition of RC parameters#4218
Conversation
lib/matplotlib/axes/_axes.py
Outdated
lib/matplotlib/axes/_axes.py
Outdated
There was a problem hiding this comment.
👎 on scatter using color cycle. This has come up before and the consensus was that scatter should be independent of color cycle because it is as scalar mappable. One of two reasons to use scatter over a plot with no line is if you want to map the color of the markers to an array (the other is to scale the size of the markers (and maybe the rotation?)).
This is also an major API break, if we do want to make scatter sometimes hook into the color cycle it should be done on the color_overhaul branch for the 2.0 release.
There was a problem hiding this comment.
Alright, I did not know about that.
lib/matplotlib/rcsetup.py
Outdated
There was a problem hiding this comment.
This should say "not a valid wisker value ['range', float, (float, float)]" or something to that effect.
|
I'm not sure why the last Travis build failed in 2.7 without args... Any idea? |
|
I kicked it to restart, smelled like a transient failure On Wed, Jun 17, 2015, 16:51 Gilles Marin notifications@github.com wrote:
|
|
It passes now. |
lib/matplotlib/axes/_axes.py
Outdated
There was a problem hiding this comment.
this probably needs a comment explaining why this is being done to prevent future developers from "fixing" this. Also, why the "not" instead of "!="?
lib/matplotlib/axes/_axes.py
Outdated
There was a problem hiding this comment.
If I understand this correctly, then a bad situation can arise. If someone has an rc file with a different value for boxplot.whiskers, but explicitly passes in a value for whis, then the rcfile's value takes precedence. That would be incorrect. Why not set the default value of whis to None and test for that?
I have similar concerns for bootstrap because it completely ignores the possibility that the user explicitly sets some value for it.
lib/matplotlib/axes/_axes.py
Outdated
There was a problem hiding this comment.
I think you meant to change whis=None
|
Can you add tests that for all of this? I think a single 5x5 grid png will give enough to cover all of the rcparams Can you add the tests of the 'default' values in another PR based on current master (so that if this PR changes the defaults we will know)? |
|
You want me to write tests for all the added rc, or only the boxplot ones? |
|
At least the boxplot ones, but if you want to do the other ones as well that would be awesome 👍 Yes, I mean a 5x5 grid of axes. If you can cover all of the rcparams in less that is fine too (5x5 was just the first size that popped into my head, not something carefully considered). And yes, the idea behind the baseline test is to verify that this does not change anything unless the user explicitly asks for things to be changed (which the last round of changes to boxplot did which was less than great). Now that I type this out, can you start by checking that we do not already have this test? |
|
I checked already for the last test. There is a basic one, but it includes |
|
Yes, doing it with a single function + single image is the idea. I would def _rctest_bxp_helper(ax, rc_dict):
with rccontext(rc_dict):
ax.boxplot(...)
def test_all_the_boxplot_rcparams():
list_of_rcdicts = [ ]
arr_of_axes = plt.subplots(5, 5).ravel()
for ax, rc_dict in zip(arr_of_axes, list_of_rcdicts):
_rctest_bxp_helper(ax, rc_dict)On Thu, Jul 2, 2015 at 3:26 PM Gilles Marin notifications@github.com
|
|
ping @Mrngilles , this needs a rebase. This also blocks #4669. |
Added xtick.position and ytick.position to rcsetup.py trying to fix Travis CI failure on 2.6 Removed x-y position parameter from rc default dic Added style rcParam + stylesheet recursion scatter, fill_between and fill_betweenx use color_cycle Added rcParameters for boxplot + validations functions Added rcParameter to choose grid axis display Comment tweaks added boxplot.flierprops + line length fixes fix: unable to get substyles from path or URL removed boxplot.fliersymbol because not needed Fixed boxplot checks spine removing modified + removed : from docstring removed color_cycle from scatter, fill_between, fill_betweenx Original behaviour of axes.grid + working rc axes.grid.orientation Fixed the get_substyles function to accept dictionnaries Fix PEP8 + OrderedDict issues in Travis Modified how we get rcParams in the boxplot method tried fixing test issues + pep8 fix travis for patch_artist linestyle issue removed the style rcParam to put it in an other PR used setdefault function + validation function + Error message fixed pep8 error fixed pep8 error (again) Comments and style fixes Fixed whiskers and bootstrap rcParams use Added tests for boxplot rc parameters and fixes added spine rc parameter test added test for axes.grid.axis rc parameter + typo fix in spines test Typo fix
|
Rebased. Hope this works, but the tests should at least be okay |
|
I guess the test had an other unexpected issue... I'm not sure if that's my code or if the problem was already there, but it seems it already happened before. |
|
Looks like the last test failure was unrelated issue. I have restarted the test |
There was a problem hiding this comment.
I think the doc string (below) needs update to reflect these changes
|
It looks good to me, I think this only needs an updated docstring for boxplot to reflect the changes |
ENH: Addition of RC parameters
|
@olgabot @Mrngilles Thanks! |
Ended the work from PR 2702, and added other RC parameters.
What was done :
styleRC parameter: you can import recursively styles from an other stylesheetscatter,fill_between,fill_betweenxusecolor_cycleboxplotparameters, and the associated validation functions when necessary.x,y, orbothgrid.