invert_axes, invert_xaxis, and invert_yaxis are named and documented in a misleading way
See original GitHub issueThe invert_xaxis and invert_yaxes options, as expected, flip the axes when set to True, so that they go from large to small left to right and down to up, opposite of the conventional bottom left small-number origin.
invert_axes, however, does something different, and for me unexpected – it swaps the x and y axes. The docstrings make it sound like setting invert_axes=True is the same as setting invert_xaxis=True and invert_yaxis=True at the same time:
invert_axes = param.Boolean(default=False, doc="""
Whether to invert the x- and y-axis""")
invert_xaxis = param.Boolean(default=False, doc="""
Whether to invert the plot x-axis.""")
invert_yaxis = param.Boolean(default=False, doc="""
Whether to invert the plot y-axis.""")
(holoviews/plotting/plot.py line 585 to 592)
At a minimum, the docstring for invert_axes should be changed to “Whether to swap the x- and y- axes.” Even clearer would be to rename invert_axes to swap_axes, but I realize this could be a hassle given backwards compatibility requirements.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
python - How to invert the x or y axis
DisplacedAussie's answer is correct, but usually a shorter method is just to reverse the single axis in question: plt.scatter(x_arr, y_arr) ax = plt.gca() ......
Read more >Invert Axes — Matplotlib 3.6.2 documentation
Invert Axes #. You can use decreasing axes by flipping the normal order of the axis limits. Should be growing... import matplotlib.pyplot as...
Read more >How to Reverse Axes in Matplotlib?
To invert X-axis and Y-axis, we can use invert_xaxis() and ... xlim() and ylim() can also be used to invert axes of a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I vote for changing
invert_axestoswap_axesto avoid confusion, and for not changinginvert_xaxisandinvert_yaxis, again to avoid confusion (as once we haveswap_axesthere’s less chance of confusion.Personally, I do like
flipa bit more but it is such a mild preference I’m not sure it is worth the confusion that would result from changing it. For holoviews 2.0, I would be very happy for such an API change though.