7
7
"private_outputs" : true ,
8
8
"provenance" : [],
9
9
"collapsed_sections" : [],
10
- "authorship_tag" : " ABX9TyMcumaRrJGtJnLYRbmh8Iop " ,
10
+ "authorship_tag" : " ABX9TyMHmEDVrEHGd9SFIIIRD4/z " ,
11
11
"include_colab_link" : true
12
12
},
13
13
"kernelspec" : {
149
149
{
150
150
"cell_type" : " markdown" ,
151
151
"source" : [
152
- " # Vertical line with matplotlib"
152
+ " # Vertical line with matplotlib, how to add a vertical line with matplotlib "
153
153
],
154
154
"metadata" : {
155
155
"id" : " LH85ipx0H255"
158
158
{
159
159
"cell_type" : " code" ,
160
160
"source" : [
161
+ " \"\"\"\n " ,
162
+ " x can be a list like:\n " ,
163
+ " plt.vlines(x = [4,14], ymin = 8, ymax = 32,\n " ,
164
+ " colors = 'purple',\n " ,
165
+ " linestyle='--')\n " ,
166
+ " \"\"\"\n " ,
161
167
" plt.vlines(x = 14, ymin = 8, ymax = 32,\n " ,
162
168
" colors = 'purple',\n " ,
163
169
" linestyle='--')"
167
173
},
168
174
"execution_count" : null ,
169
175
"outputs" : []
176
+ },
177
+ {
178
+ "cell_type" : " markdown" ,
179
+ "source" : [
180
+ " # Plotting an array, How to plot an array"
181
+ ],
182
+ "metadata" : {
183
+ "id" : " foc9sa2MM7mh"
184
+ }
185
+ },
186
+ {
187
+ "cell_type" : " code" ,
188
+ "source" : [
189
+ " x = np.zeros(20)\n " ,
190
+ " x[:5] = 10\n " ,
191
+ " x[5:15] = np.arange(12,32,2)\n " ,
192
+ " x[15:] = 30\n " ,
193
+ " plt.plot(x)"
194
+ ],
195
+ "metadata" : {
196
+ "id" : " by-eKmBNM-W0"
197
+ },
198
+ "execution_count" : null ,
199
+ "outputs" : []
200
+ },
201
+ {
202
+ "cell_type" : " markdown" ,
203
+ "source" : [
204
+ " # Months list"
205
+ ],
206
+ "metadata" : {
207
+ "id" : " U2EfN1b6WCVd"
208
+ }
209
+ },
210
+ {
211
+ "cell_type" : " code" ,
212
+ "source" : [
213
+ " months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n "
214
+ ],
215
+ "metadata" : {
216
+ "id" : " YH7Yi2BWWEg4"
217
+ },
218
+ "execution_count" : null ,
219
+ "outputs" : []
220
+ },
221
+ {
222
+ "cell_type" : " markdown" ,
223
+ "source" : [
224
+ " # Getting the execution time"
225
+ ],
226
+ "metadata" : {
227
+ "id" : " dOXnCxfwWLo1"
228
+ }
229
+ },
230
+ {
231
+ "cell_type" : " code" ,
232
+ "source" : [
233
+ " import time\n " ,
234
+ " start_time = time.time()\n " ,
235
+ " main()\n " ,
236
+ " print(\" --- %s seconds ---\" % (time.time() - start_time))"
237
+ ],
238
+ "metadata" : {
239
+ "id" : " 9j6AQZAzWX53"
240
+ },
241
+ "execution_count" : null ,
242
+ "outputs" : []
170
243
}
171
244
]
172
245
}
0 commit comments