Quantcast

Style axes for imshow only

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
jni
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Style axes for imshow only

jni
Is there a way to set different axis style for imshow plots using a style file?

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Style axes for imshow only

tcaswell
No, `Axes` do not know a head of time what type of artists they will host (which is both a feature and a bug depending on who you ask).

`imshow` _does_ change some `Axes` properties (in addition to adding the requisite artists) such as setting the aspect ratio.   In principle we could have an `image.axis.top` and friends rcParams, but then we maybe should have them for _all_ of the 'basic' plotting methods.  Not only would this lead to a great explosion of rcParams, we would also have to deal with conflicts / rules about how to settle conflicts (which sounds like a big mess to me).

I suggest writting a helper function like:

def my_imshow_that_changes_axis_visibilty(ax, data, **kwargs):
     # set axis visibility as you desire
     return ax.imshow(data, **kwargs)

or

def set_up_axes_axis_the_way_i_like_for_imshow(ax):
    # set up the axis the way you want


Tom

On Mon, Nov 7, 2016 at 8:40 PM Juan Nunez-Iglesias <[hidden email]> wrote:
Is there a way to set different axis style for imshow plots using a style file?
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Loading...