Python Forum
Thread Rating:
  • 2 Vote(s) - 1.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extend the scale
#1
Hello,

I am using matplotlib to make a scatter-plot, here is the code:
if os.path.isfile("example.txt"):
    days_KECS, intensity_KECS = np.loadtxt("example.txt", unpack=True,
                               converters={ 0: mdates.strpdate2num('%Y%m%d')})
    plt.plot_date(x=days_KECS, y=intensity_KECS, fmt="ro")
    plt.title("KECS intensity datas")
    plt.ylabel("Intensity")
    plt.xlabel("Date")
    plt.grid(True)
    plt.show()
else:
    print("MISSING DATAS")
my question is, how can I set the y axis (intensity datas), that the max values wouldn't be on the edge, so the max value on the scale would be a bit bigger?
Thanks
Reply
#2
Perhaps use matplotlib.pyplot.ylim()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to properly scale text in postscript conversion to pdf? philipbergwerf 3 1,118 Nov-07-2022, 01:30 PM
Last Post: philipbergwerf
  KeyError: 0 when trying to dedupe and match records at scale Catalytic 1 2,164 Apr-07-2022, 06:34 PM
Last Post: deanhystad
  Matplotlib scale julienhofmann 0 1,801 Apr-04-2021, 08:50 AM
Last Post: julienhofmann
  View and extend native python class PythonDev 2 1,647 Oct-24-2020, 08:59 PM
Last Post: Gribouillis
  Not able to update y2 axis scale in plotly ankitawadhwa 0 1,953 Jan-27-2020, 06:44 PM
Last Post: ankitawadhwa
  Why the this extend example is printing 2 two times? sbabu 1 1,476 Jan-12-2020, 07:30 AM
Last Post: Gribouillis
  Change the scale on a Matplotlib Interactive Graph khatharsis 0 2,840 Oct-13-2019, 06:14 AM
Last Post: khatharsis
  How to manually define color bar scale in seaborn heatmap SriRajesh 3 18,285 Sep-08-2019, 11:12 AM
Last Post: RudraMohan
  python decimal scale precision massimo_m 5 5,408 Aug-22-2019, 11:47 AM
Last Post: perfringo
  How to extend the sclale of a graph? Krszt 1 2,315 Nov-13-2018, 11:16 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020