1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] how can I access particular y and x axis using ax = fig.add_subplot(3, 3, i +1), for...

Discussão em 'Python' iniciado por Stack, Setembro 6, 2025.

  1. Stack

    Stack Membro Participativo

    It seems accessing axis is easy with

    fig, ((ax1, ax2,ax3,ax4)) = plt.subplots(2, 4,figsize=(10,8),layout='tight')
    subfigs = fig.subfigures(2, 4)


    For example, if I want the ticks (labeling too) on the y-axis of two rows (first column) and the x-axis on the second row only, I can use a particular ax(i) for them. However, with ax = fig.add_subplot(3, 3, i +1), it removes labelling and tricks of all the axes while using plt.setp(ax.get_xticklabels(), visible=False). How can I access a particular axis with the latter case (only y of the first column and x of the last row for labeling and ticks, rest to be off)? Thanks....

    Continue reading...

Compartilhe esta Página