Python 3.11.5 (main, Sep 11 2023, 08:31:25) [Clang 14.0.6 ]

Type "copyright", "credits" or "license" for more information.


IPython 8.15.0 -- An enhanced Interactive Python.


Restarting kernel...


In [1]: runfile('/Users/py4cs/Desktop/day7.py', wdir='/Users/py4cs/Desktop')


In [2]: def square(x):

   ...: return x**2

   ...:


In [3]: eval_f(square, [-1, 10, 20, 42])

Out[3]: [1, 100, 400, 1764]


In [4]: xs = [-1, 10, 20, 42]


In [5]: [x for x in xs]

Out[5]: [-1, 10, 20, 42]


In [6]: [x**2 for x in xs]

Out[6]: [1, 100, 400, 1764]


In [7]: [square(x) for x in xs]

Out[7]: [1, 100, 400, 1764]


In [8]: runfile('/Users/py4cs/Desktop/day7.py', wdir='/Users/py4cs/Desktop')


In [9]: eval_f2(square, [-1, 10, 20, 42])

Out[9]: [1, 100, 400, 1764]


In [10]: %timeit eval_f(square, [-1, 10, 20, 42])

207 ns ± 0.51 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)


In [11]: %timeit eval_f2(square, [-1, 10, 20, 42])

261 ns ± 0.348 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)


In [12]: eval_f(lambda x: x**2, [-1, 10, 20, 42])

Out[12]: [1, 100, 400, 1764]


In [13]: map(lambda x: x**2, [-1, 10, 20, 42])

Out[13]: <map at 0x15d166620>


In [14]: list(map(lambda x: x**2, [-1, 10, 20, 42]))

Out[14]: [1, 100, 400, 1764]


In [15]: runfile('/Users/py4cs/Desktop/day7.py', wdir='/Users/py4cs/Desktop')


In [16]: eval_f3(lambda x: x**2, [-1, 10, 20, 42])

Out[16]: <map at 0x15d167940>


In [17]: runfile('/Users/py4cs/Desktop/day7.py', wdir='/Users/py4cs/Desktop')


In [18]: eval_f3(lambda x: x**2, [-1, 10, 20, 42])

Out[18]: [1, 100, 400, 1764]


In [19]: runfile('/Users/py4cs/Desktop/day7.py', wdir='/Users/py4cs/Desktop')


In [20]: eval_f4(lambda x: x**2, [-1, 10, 20, 42])

Traceback (most recent call last):


Cell In[20], line 1

eval_f4(lambda x: x**2, [-1, 10, 20, 42])


NameError: name 'eval_f4' is not defined



In [21]: eval4(lambda x: x**2, [-1, 10, 20, 42])

Out[21]: <map at 0x15d165390>


In [22]: list(eval4(lambda x: x**2, [-1, 10, 20, 42]))

Out[22]: [1, 100, 400, 1764]


In [23]: import math


In [24]: map(math.exp, [0, 1, 2, 3])

Out[24]: <map at 0x15d166860>


In [25]: list(map(math.exp, [0, 1, 2, 3]))

Out[25]: [1.0, 2.718281828459045, 7.38905609893065, 20.085536923187668]


In [26]: def is_positive(n):

    ...: return n > 0

    ...:


In [27]: is_positive(-3)

Out[27]: False


In [28]: is_positive(3.5)

Out[28]: True


In [29]: filter(is_positive, [-3, -1, 1, 3])

Out[29]: <filter at 0x15d166ec0>


In [30]: list(filter(is_positive, [-3, -1, 1, 3]))

Out[30]: [1, 3]


In [31]: [n for n in [-3, -1, 1, 3] if n > 0]

Out[31]: [1, 3]


In [32]: list(filter(lambda n: n>0, [-3, -1, 1, 3]))

Out[32]: [1, 3]


In [33]: c = "The quick brown fox jumps".split()


In [34]: c

Out[34]: ['The', 'quick', 'brown', 'fox', 'jumps']


In [35]: def len_gr_4(s):

    ...: return len(s) > 4

    ...:


In [36]: len_gr_4("The")

Out[36]: False


In [37]: len_gr_4("quick")

Out[37]: True


In [38]: list(filter(len_gr_4, c))

Out[38]: ['quick', 'brown', 'jumps']


In [39]: list(filter(lambda s: len(s) > 4, c))

Out[39]: ['quick', 'brown', 'jumps']


In [40]: [ word for word in c if len(word) > 4]

Out[40]: ['quick', 'brown', 'jumps']


In [41]: from functools import reduce


In [42]: def f(x, y):

    ...: return x + y

    ...:


In [43]: reduce(f, [1, 3, 5], 100)

Out[43]: 109


In [44]: reduce(f, [1, 3, 5], 1000)

Out[44]: 1009


In [45]: reduce(f, [1, 3, 5, -1000], 1000)

Out[45]: 9


In [46]: reduce(lambda x,y: x+y, [1, 3, 5, -1000], 1000)

Out[46]: 9


In [47]: reduce(lambda x,y: x*y, [1, 3, 5], 1)

Out[47]: 15


In [48]: reduce(lambda x,y: x*y, [1, 3, 5], 2)

Out[48]: 30


In [49]: def f(x, y):

    ...: print(f"{called f with {x=} {y=} -> return {x+y}")

    ...: return x + y

Cell In[49], line 2

print(f"{called f with {x=} {y=} -> return {x+y}")

^

SyntaxError: f-string: expecting '}'



In [50]: def f(x, y):

    ...: print(f"called f with {x=} {y=} -> return {x+y}")

    ...: return x + y

    ...:


In [51]: f(10, 20)

called f with x=10 y=20 -> return 30

Out[51]: 30


In [52]: reduce(f, [1, 3, 5], 100)

called f with x=100 y=1 -> return 101

called f with x=101 y=3 -> return 104

called f with x=104 y=5 -> return 109

Out[52]: 109


In [53]: "Hello" + "World"

Out[53]: 'HelloWorld'


In [54]: reduce(f, "World", "Hello")

called f with x='Hello' y='W' -> return HelloW

called f with x='HelloW' y='o' -> return HelloWo

called f with x='HelloWo' y='r' -> return HelloWor

called f with x='HelloWor' y='l' -> return HelloWorl

called f with x='HelloWorl' y='d' -> return HelloWorld

Out[54]: 'HelloWorld'


In [55]: runcell(0, '/Users/py4cs/Desktop/plotting-array-matplotlib.py')


In [56]: t

Out[56]:

array([ 0. , 0.10506999, 0.21013998, 0.31520997, 0.42027995,

0.52534994, 0.63041993, 0.73548992, 0.84055991, 0.9456299 ,

1.05069988, 1.15576987, 1.26083986, 1.36590985, 1.47097984,

1.57604983, 1.68111981, 1.7861898 , 1.89125979, 1.99632978,

2.10139977, 2.20646976, 2.31153975, 2.41660973, 2.52167972,

2.62674971, 2.7318197 , 2.83688969, 2.94195968, 3.04702966,

3.15209965, 3.25716964, 3.36223963, 3.46730962, 3.57237961,

3.67744959, 3.78251958, 3.88758957, 3.99265956, 4.09772955,

4.20279954, 4.30786952, 4.41293951, 4.5180095 , 4.62307949,

4.72814948, 4.83321947, 4.93828946, 5.04335944, 5.14842943,

5.25349942, 5.35856941, 5.4636394 , 5.56870939, 5.67377937,

5.77884936, 5.88391935, 5.98898934, 6.09405933, 6.19912932,

6.3041993 , 6.40926929, 6.51433928, 6.61940927, 6.72447926,

6.82954925, 6.93461924, 7.03968922, 7.14475921, 7.2498292 ,

7.35489919, 7.45996918, 7.56503917, 7.67010915, 7.77517914,

7.88024913, 7.98531912, 8.09038911, 8.1954591 , 8.30052908,

8.40559907, 8.51066906, 8.61573905, 8.72080904, 8.82587903,

8.93094902, 9.036019 , 9.14108899, 9.24615898, 9.35122897,

9.45629896, 9.56136895, 9.66643893, 9.77150892, 9.87657891,

9.9816489 , 10.08671889, 10.19178888, 10.29685886, 10.40192885,

10.50699884, 10.61206883, 10.71713882, 10.82220881, 10.9272788 ,

11.03234878, 11.13741877, 11.24248876, 11.34755875, 11.45262874,

11.55769873, 11.66276871, 11.7678387 , 11.87290869, 11.97797868,

12.08304867, 12.18811866, 12.29318864, 12.39825863, 12.50332862,

12.60839861, 12.7134686 , 12.81853859, 12.92360857, 13.02867856,

13.13374855, 13.23881854, 13.34388853, 13.44895852, 13.55402851,

13.65909849, 13.76416848, 13.86923847, 13.97430846, 14.07937845,

14.18444844, 14.28951842, 14.39458841, 14.4996584 , 14.60472839,

14.70979838, 14.81486837, 14.91993835, 15.02500834, 15.13007833,

15.23514832, 15.34021831, 15.4452883 , 15.55035829, 15.65542827,

15.76049826, 15.86556825, 15.97063824, 16.07570823, 16.18077822,

16.2858482 , 16.39091819, 16.49598818, 16.60105817, 16.70612816,

16.81119815, 16.91626813, 17.02133812, 17.12640811, 17.2314781 ,

17.33654809, 17.44161808, 17.54668807, 17.65175805, 17.75682804,

17.86189803, 17.96696802, 18.07203801, 18.177108 , 18.28217798,

18.38724797, 18.49231796, 18.59738795, 18.70245794, 18.80752793,

18.91259791, 19.0176679 , 19.12273789, 19.22780788, 19.33287787,

19.43794786, 19.54301785, 19.64808783, 19.75315782, 19.85822781,

19.9632978 , 20.06836779, 20.17343778, 20.27850776, 20.38357775,

20.48864774, 20.59371773, 20.69878772, 20.80385771, 20.90892769,

21.01399768, 21.11906767, 21.22413766, 21.32920765, 21.43427764,

21.53934762, 21.64441761, 21.7494876 , 21.85455759, 21.95962758,

22.06469757, 22.16976756, 22.27483754, 22.37990753, 22.48497752,

22.59004751, 22.6951175 , 22.80018749, 22.90525747, 23.01032746,

23.11539745, 23.22046744, 23.32553743, 23.43060742, 23.5356774 ,

23.64074739, 23.74581738, 23.85088737, 23.95595736, 24.06102735,

24.16609734, 24.27116732, 24.37623731, 24.4813073 , 24.58637729,

24.69144728, 24.79651727, 24.90158725, 25.00665724, 25.11172723,

25.21679722, 25.32186721, 25.4269372 , 25.53200718, 25.63707717,

25.74214716, 25.84721715, 25.95228714, 26.05735713, 26.16242712,

26.2674971 , 26.37256709, 26.47763708, 26.58270707, 26.68777706,

26.79284705, 26.89791703, 27.00298702, 27.10805701, 27.213127 ,

27.31819699, 27.42326698, 27.52833696, 27.63340695, 27.73847694,

27.84354693, 27.94861692, 28.05368691, 28.1587569 , 28.26382688,

28.36889687, 28.47396686, 28.57903685, 28.68410684, 28.78917683,

28.89424681, 28.9993168 , 29.10438679, 29.20945678, 29.31452677,

29.41959676, 29.52466674, 29.62973673, 29.73480672, 29.83987671,

29.9449467 , 30.05001669, 30.15508667, 30.26015666, 30.36522665,

30.47029664, 30.57536663, 30.68043662, 30.78550661, 30.89057659,

30.99564658, 31.10071657, 31.20578656, 31.31085655, 31.41592654])


In [57]: len(t)

Out[57]: 300


In [58]: t.shape

Out[58]: (300,)


In [59]: np.cos(t)

Out[59]:

array([ 1. , 0.99448523, 0.97800173, 0.95073131, 0.91297475,

0.86514849, 0.80778004, 0.74150213, 0.66704579, 0.58523223,

0.49696383, 0.40321414, 0.30501718, 0.20345601, 0.09965082,

-0.00525348, -0.11009983, -0.21373183, -0.31500646, -0.41280672,

-0.5060539 , -0.59371954, -0.67483672, -0.74851075, -0.81392904,

-0.87037007, -0.9172113 , -0.95393611, -0.98013943, -0.99553225,

-0.9999448 , -0.99332841, -0.97575606, -0.94742155, -0.90863741,

-0.85983141, -0.80154186, -0.73441166, -0.65918122, -0.57668032,

-0.4878189 , -0.39357705, -0.29499422, -0.19315774, -0.08919081,

0.01575985, 0.12053668, 0.22398405, 0.32496098, 0.42235373,

0.51508811, 0.6021413 , 0.68255314, 0.75543673, 0.81998819,

0.87549556, 0.9213466 , 0.9570356 , 0.98216893, 0.99646937,

0.99977921, 0.99206194, 0.97340267, 0.9440072 , 0.90419976,

0.8544194 , 0.79521519, 0.7272401 , 0.65124389, 0.56806475,

0.47862011, 0.3838965 , 0.28493869, 0.18283814, 0.07872096,

-0.02626448, -0.13096023, -0.23421154, -0.33487961, -0.43185411,

-0.52406545, -0.61049659, -0.69019422, -0.76227932, -0.82595682,

-0.88052439, -0.92538018, -0.96002943, -0.98409 , -0.99729649,

-0.99950325, -0.99068595, -0.97094182, -0.94048864, -0.89966229,

-0.84891307, -0.78880073, -0.71998827, -0.64323466, -0.55938646,

-0.46936848, -0.37417358, -0.27485171, -0.17249835, -0.06824241,

0.03676621, 0.14136931, 0.24441318, 0.34476128, 0.44130682,

0.53298494, 0.61878448, 0.6977591 , 0.76903775, 0.83183427,

0.88545603, 0.9293116 , 0.96291729, 0.98590243, 0.99801351,

0.99911695, 0.98920059, 0.96837378, 0.93686625, 0.8950255 ,

0.84331303, 0.78229919, 0.71265695, 0.63515442, 0.55064642,

0.46006504, 0.36440935, 0.26473439, 0.16213952, 0.05775633,

-0.04726388, -0.1517628 , -0.25458784, -0.35460489, -0.45071081,

-0.54184559, -0.62700406, -0.70524695, -0.77571129, -0.83761988,

-0.89028991, -0.93314043, -0.96569884, -0.98760602, -0.99862035,

-0.99862035, -0.98760602, -0.96569884, -0.93314043, -0.89028991,

-0.83761988, -0.77571129, -0.70524695, -0.62700406, -0.54184559,

-0.45071081, -0.35460489, -0.25458784, -0.1517628 , -0.04726388,

0.05775633, 0.16213952, 0.26473439, 0.36440935, 0.46006504,

0.55064642, 0.63515442, 0.71265695, 0.78229919, 0.84331303,

0.8950255 , 0.93686625, 0.96837378, 0.98920059, 0.99911695,

0.99801351, 0.98590243, 0.96291729, 0.9293116 , 0.88545603,

0.83183427, 0.76903775, 0.6977591 , 0.61878448, 0.53298494,

0.44130682, 0.34476128, 0.24441318, 0.14136931, 0.03676621,

-0.06824241, -0.17249835, -0.27485171, -0.37417358, -0.46936848,

-0.55938646, -0.64323466, -0.71998827, -0.78880073, -0.84891307,

-0.89966229, -0.94048864, -0.97094182, -0.99068595, -0.99950325,

-0.99729649, -0.98409 , -0.96002943, -0.92538018, -0.88052439,

-0.82595682, -0.76227932, -0.69019422, -0.61049659, -0.52406545,

-0.43185411, -0.33487961, -0.23421154, -0.13096023, -0.02626448,

0.07872096, 0.18283814, 0.28493869, 0.3838965 , 0.47862011,

0.56806475, 0.65124389, 0.7272401 , 0.79521519, 0.8544194 ,

0.90419976, 0.9440072 , 0.97340267, 0.99206194, 0.99977921,

0.99646937, 0.98216893, 0.9570356 , 0.9213466 , 0.87549556,

0.81998819, 0.75543673, 0.68255314, 0.6021413 , 0.51508811,

0.42235373, 0.32496098, 0.22398405, 0.12053668, 0.01575985,

-0.08919081, -0.19315774, -0.29499422, -0.39357705, -0.4878189 ,

-0.57668032, -0.65918122, -0.73441166, -0.80154186, -0.85983141,

-0.90863741, -0.94742155, -0.97575606, -0.99332841, -0.9999448 ,

-0.99553225, -0.98013943, -0.95393611, -0.9172113 , -0.87037007,

-0.81392904, -0.74851075, -0.67483672, -0.59371954, -0.5060539 ,

-0.41280672, -0.31500646, -0.21373183, -0.11009983, -0.00525348,

0.09965082, 0.20345601, 0.30501718, 0.40321414, 0.49696383,

0.58523223, 0.66704579, 0.74150213, 0.80778004, 0.86514849,

0.91297475, 0.95073131, 0.97800173, 0.99448523, 1. ])


In [60]: np.cos(t)**2

Out[60]:

array([1.00000000e+00, 9.89000863e-01, 9.56487375e-01, 9.03890019e-01,

8.33522895e-01, 7.48481915e-01, 6.52508589e-01, 5.49825410e-01,

4.44950086e-01, 3.42496768e-01, 2.46973049e-01, 1.62581642e-01,

9.30354783e-02, 4.13943492e-02, 9.93028608e-03, 2.75990023e-05,

1.21219721e-02, 4.56812946e-02, 9.92290723e-02, 1.70409388e-01,

2.56090552e-01, 3.52502891e-01, 4.55404594e-01, 5.60268340e-01,

6.62480488e-01, 7.57544054e-01, 8.41276572e-01, 9.09994097e-01,

9.60673298e-01, 9.91084463e-01, 9.99889607e-01, 9.86701333e-01,

9.52099881e-01, 8.97607593e-01, 8.25621944e-01, 7.39310053e-01,

6.42469346e-01, 5.39360479e-01, 4.34519887e-01, 3.32560194e-01,

2.37967274e-01, 1.54902891e-01, 8.70215884e-02, 3.73099112e-02,

7.95500106e-03, 2.48372740e-04, 1.45290913e-02, 5.01688544e-02,

1.05599635e-01, 1.78382671e-01, 2.65315760e-01, 3.62574145e-01,

4.65878793e-01, 5.70684657e-01, 6.72380640e-01, 7.66492469e-01,

8.48879550e-01, 9.15917134e-01, 9.64655800e-01, 9.92951215e-01,

9.99558477e-01, 9.84186890e-01, 9.47512751e-01, 8.91149596e-01,

8.17577208e-01, 7.30032519e-01, 6.32367193e-01, 5.28878167e-01,

4.24118602e-01, 3.22697556e-01, 2.29077206e-01, 1.47376524e-01,

8.11900582e-02, 3.34297841e-02, 6.19698927e-03, 6.89822727e-04,

1.71505808e-02, 5.48550469e-02, 1.12144355e-01, 1.86497972e-01,

2.74644597e-01, 3.72706082e-01, 4.76368060e-01, 5.81069762e-01,

6.82204674e-01, 7.75323209e-01, 8.56328473e-01, 9.21656514e-01,

9.68433124e-01, 9.94600293e-01, 9.99006756e-01, 9.81458644e-01,

9.42728013e-01, 8.84518877e-01, 8.09392238e-01, 7.20653409e-01,

6.22206590e-01, 5.18383104e-01, 4.13750824e-01, 3.12913211e-01,

2.20306770e-01, 1.40005867e-01, 7.55434626e-02, 2.97556812e-02,

4.65702698e-03, 1.35175403e-03, 1.99852830e-02, 5.97378029e-02,

1.18860340e-01, 1.94751707e-01, 2.84072945e-01, 3.82894228e-01,

4.86867762e-01, 5.91419068e-01, 6.91948251e-01, 7.84032373e-01,

8.63620051e-01, 9.27209702e-01, 9.72003601e-01, 9.96030969e-01,

9.98234687e-01, 9.78517799e-01, 9.37747778e-01, 8.77718366e-01,

8.01070650e-01, 7.11176864e-01, 6.11992025e-01, 5.07879923e-01,

4.03421132e-01, 3.03211477e-01, 2.11659839e-01, 1.32794172e-01,

7.00842951e-02, 2.62892250e-02, 3.33579421e-03, 2.23387437e-03,

2.30319462e-02, 6.48149663e-02, 1.25744626e-01, 2.03140230e-01,

2.93596640e-01, 3.93134086e-01, 4.97373262e-01, 6.01728007e-01,

7.01607069e-01, 7.92616117e-01, 8.70751066e-01, 9.32574247e-01,

9.75365654e-01, 9.97242613e-01, 9.97242613e-01, 9.75365654e-01,

9.32574247e-01, 8.70751066e-01, 7.92616117e-01, 7.01607069e-01,

6.01728007e-01, 4.97373262e-01, 3.93134086e-01, 2.93596640e-01,

2.03140230e-01, 1.25744626e-01, 6.48149663e-02, 2.30319462e-02,

2.23387437e-03, 3.33579421e-03, 2.62892250e-02, 7.00842951e-02,

1.32794172e-01, 2.11659839e-01, 3.03211477e-01, 4.03421132e-01,

5.07879923e-01, 6.11992025e-01, 7.11176864e-01, 8.01070650e-01,

8.77718366e-01, 9.37747778e-01, 9.78517799e-01, 9.98234687e-01,

9.96030969e-01, 9.72003601e-01, 9.27209702e-01, 8.63620051e-01,

7.84032373e-01, 6.91948251e-01, 5.91419068e-01, 4.86867762e-01,

3.82894228e-01, 2.84072945e-01, 1.94751707e-01, 1.18860340e-01,

5.97378029e-02, 1.99852830e-02, 1.35175403e-03, 4.65702698e-03,

2.97556812e-02, 7.55434626e-02, 1.40005867e-01, 2.20306770e-01,

3.12913211e-01, 4.13750824e-01, 5.18383104e-01, 6.22206590e-01,

7.20653409e-01, 8.09392238e-01, 8.84518877e-01, 9.42728013e-01,

9.81458644e-01, 9.99006756e-01, 9.94600293e-01, 9.68433124e-01,

9.21656514e-01, 8.56328473e-01, 7.75323209e-01, 6.82204674e-01,

5.81069762e-01, 4.76368060e-01, 3.72706082e-01, 2.74644597e-01,

1.86497972e-01, 1.12144355e-01, 5.48550469e-02, 1.71505808e-02,

6.89822727e-04, 6.19698927e-03, 3.34297841e-02, 8.11900582e-02,

1.47376524e-01, 2.29077206e-01, 3.22697556e-01, 4.24118602e-01,

5.28878167e-01, 6.32367193e-01, 7.30032519e-01, 8.17577208e-01,

8.91149596e-01, 9.47512751e-01, 9.84186890e-01, 9.99558477e-01,

9.92951215e-01, 9.64655800e-01, 9.15917134e-01, 8.48879550e-01,

7.66492469e-01, 6.72380640e-01, 5.70684657e-01, 4.65878793e-01,

3.62574145e-01, 2.65315760e-01, 1.78382671e-01, 1.05599635e-01,

5.01688544e-02, 1.45290913e-02, 2.48372740e-04, 7.95500106e-03,

3.73099112e-02, 8.70215884e-02, 1.54902891e-01, 2.37967274e-01,

3.32560194e-01, 4.34519887e-01, 5.39360479e-01, 6.42469346e-01,

7.39310053e-01, 8.25621944e-01, 8.97607593e-01, 9.52099881e-01,

9.86701333e-01, 9.99889607e-01, 9.91084463e-01, 9.60673298e-01,

9.09994097e-01, 8.41276572e-01, 7.57544054e-01, 6.62480488e-01,

5.60268340e-01, 4.55404594e-01, 3.52502891e-01, 2.56090552e-01,

1.70409388e-01, 9.92290723e-02, 4.56812946e-02, 1.21219721e-02,

2.75990023e-05, 9.93028608e-03, 4.13943492e-02, 9.30354783e-02,

1.62581642e-01, 2.46973049e-01, 3.42496768e-01, 4.44950086e-01,

5.49825410e-01, 6.52508589e-01, 7.48481915e-01, 8.33522895e-01,

9.03890019e-01, 9.56487375e-01, 9.89000863e-01, 1.00000000e+00])


In [61]: runcell(1, '/Users/py4cs/Desktop/plotting-array-matplotlib.py')

Out[61]: Text(0, 0.5, 'y(t)')


In [62]: runcell(1, '/Users/py4cs/Desktop/plotting-array-matplotlib.py')

Out[62]: Text(0, 0.5, 'y(t)')


In [63]: runcell(1, '/Users/py4cs/Desktop/plotting-array-matplotlib.py')

Out[63]: Text(0, 0.5, 'y(t)')


In [64]: %matplotlib qt


In [65]: runcell(1, '/Users/py4cs/Desktop/plotting-array-matplotlib.py')

Out[65]: Text(0, 0.5, 'y(t)')


In [66]: runcell(2, '/Users/py4cs/Desktop/plotting-array-matplotlib.py')


In [67]: runcell(2, '/Users/py4cs/Desktop/plotting-array-matplotlib.py')


In [68]: runcell(2, '/Users/py4cs/Desktop/plotting-array-matplotlib.py')


In [69]: runcell(0, '/Users/py4cs/Desktop/plotting-array-matplotlib.py')


In [70]: runcell(1, '/Users/py4cs/Desktop/plotting-array-matplotlib.py')

Out[70]: Text(0, 0.5, 'y(t)')


In [71]: runfile('/Users/py4cs/Desktop/plotting-array-matplotlib.py', wdir='/Users/py4cs/Desktop')


In [72]: make_plot()


In [73]: runfile('/Users/py4cs/Desktop/plotting-array-matplotlib.py', wdir='/Users/py4cs/Desktop')


In [74]: runfile('/Users/py4cs/Desktop/plotting-array-matplotlib.py', wdir='/Users/py4cs/Desktop')


In [75]: fig

Out[75]:




In [76]: ax

Out[76]: <Axes: xlabel='t', ylabel='y(t)'>


In [77]: