How do I plot list of tuples in Python?

后端 未结 5 933
自闭症患者
自闭症患者 2020-12-04 11:03

I have the following data set. I would like to use Python or Gnuplot to plot the data. The tuples are of the form (x, y). The Y-axis should be a log axis, th

5条回答
  •  北海茫月
    2020-12-04 11:37

    With gnuplot using gplot.py

    from gplot import *
    
    l = [(0, 6.0705199999997801e-08), (1, 2.1015700100300739e-08), 
     (2, 7.6280656623374823e-09), (3, 5.7348209304555086e-09), 
     (4, 3.6812203579604238e-09), (5, 4.1572516753310418e-09)]
    
    gplot.log('y')
    gplot(*zip(*l))
    

    enter image description here

提交回复
热议问题