0

Im using Matplotlib, and plotting a basic line graph. I have an very large set of data and I need my Y-axis to be much bigger.

How do o make my graph much longer but not any taller? I found I can increase the overall graph size in proportion using the save function, but thats about it.

Heres a portion of my code:

x_data = range(0, len(self.hydro))
    plt.figure()
    plt.axhline(y=0, color='black')
    plt.ylim(3, -3) 
    plt.plot(x_data, self.hydro, linewidth=1.0, label="hydrophobicity", color='r')
    plt.plot(x_data, self.amphi, linewidth=1.0, label="amphipathicity", color='g')

    #plt.legend()
    plt.xlabel("Residue Number")
    plt.ylabel("Value")
    show()

Thanks a ton :)

2
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by griswolf
1

Confused. Want wider, but not taller... but you are calling it the Y axis? Assuming you misspoke, will this do what you need? (There's a parallel method for the Y axis)

0

Sorry, yes I did mean the x-axis.

Thank you I will look into that now.

0

This changes my scale, but the actual graph is no bigger. My data ends up scrunched. How can I just make my graph just longer?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.