MBravoS / splotch

Simple PLOTs, Contours and Histograms is a small package with wrapper functions designed to simplify plotting calls from matplotlib.
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Suggested functionality for "multi" #3

Closed AstroRobin closed 5 years ago

AstroRobin commented 5 years ago

The "multi" flag is good so that you don't accidentally invert an axis twice (i.e. do nothing) or similar toggle a grid twice. The problem I see is that all the other plotting features (limits, titles, labels) are locked up, doomed to the same fate as grid and invert.

A simple way to get around double toggling the inversion is to use yaxis_inverted() which returns true if the axis is already inverted. You can check if the inversion operation has already been done and if so, do nothing.

The grid property is a little bit harder and requires dangerously checking some private variables, it seems this is the only solution, however. The following code should work to detect either major or minor grids: xGridOn = ax.xaxis._gridOnMajor or ax.xaxis._gridOnMinor yGridOn = ax.yaxis._gridOnMajor or ax.yaxis._gridOnMinor

Some basic tests show that this works well in practice.

MBravoS commented 5 years ago

Removed as of 0.2.5.0