cartopy
cartopy copied to clipboard
Add get_* and set_* methods for the FeatureArtist
Rationale
Support standard matplotlib setters and getters. But not their respective properties (because they have hiddeous details, such as artist.figure
being the actual data that is stored on the artist, whereas artist.facecolor is just an alias to artist._facecolor
).
Implications
One can use standard matplotlib machinery for stylisation, including:
feature_artist.set_facecolor('red')
plt.setp(feature_artist, 'facecolor', 'red')
Closes #1226.
Couple of thoughts for myself:
- should I deal with pchanged and prop observers
- should I prevent certain properties (non-stylistic ones, such as data, transform etc.)
Can I bump this? I ran across it a few years ago (roundabout the time of this PR) and I ran across it again recently (my workaround is to access the private "_kwargs", which does work but doing it gives me the willies). For folks familiar with matplotlib, it's counterintuitive that things like facecolor can be set at creation-time but can't be set post-creation on a FeatureArtist (because it's an artist, right?). I'm not super familiar with the inner workings so I don't know if this is still the best way to do it, but might be worth a look?
Superseded by #2323.