Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 4eeb52d

Browse files
authored
Fix figures (#19)
* fix figures * fix 04 * MyST * myst_try * fix by MyST
1 parent 070bd01 commit 4eeb52d

5 files changed

Lines changed: 41 additions & 10 deletions

File tree

book/01/Exercises/01.ipynb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,12 @@
973973
"\n",
974974
"Given that we have a rectangle with a height of $3$ cm, width of $5$ cm and a cutout circle of radius $0.6$ cm, as shown below. \n",
975975
"\n",
976-
"![image.png](01.png)\n",
976+
"```{image} 01.png\n",
977+
":alt: rectangle\n",
978+
":width: 400px\n",
979+
":align: center\n",
980+
"```\n",
981+
"\n",
977982
"\n",
978983
"In the code cell bellow you will find a script that computes the remainder area. However there is a mistake in the code. \n",
979984
"<!--\n",

book/04/Theory/01.ipynb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@
125125
"source": [
126126
"Hmmmm, that's strange... we altered only one list but both were changed in the end! Why would that happen? Welp, the two reasons behind that are $1)$ what a variable actually <b>is</b>; and, $2)$ what the $=$ operator actually does. In short, variables are just links to the spatial location where objects are stored. By reassigning the value of a variable, you're just changing this link.<br><br>So, first, when you create 2 lists, <b><code>var1 = [1, 2, 3]</code></b> and <b><code>var2 = [555, 777, 888]</code></b>, you create two different objects: <b><code>var1</code></b>, a variable referring to the list <b><code>[1, 2, 3]</code></b>; and <b><code>var2</code></b>, a variable referring to the list <b><code>[555, 777, 888]</code></b>. Then, with the line <b><code>var1 = var2</code></b> you don't actually change the content of <b><code>var1</code></b> — you just make it refer to the list <b><code>[555, 777, 888]</code></b>! Thus, by changing one element of <b><code>var2</code></b> you will be able to see changes in <b><code>var1</code></b> as well since they both refer to the same object in memory! Here's a sketch of the described situation:\n",
127127
"\n",
128-
"![image.png](https://raw.githubusercontent.com/mike-mendoza/Bivariate_NPBN_workshop_files/main/files_pyhton_book_test/01.png) \n",
128+
"```{image} 01.png\n",
129+
":alt: rectangle\n",
130+
":width: 800px\n",
131+
":align: center\n",
132+
"```\n",
129133
"\n",
130134
"You can also see this by using the <b><code>id()</code></b> function. It returns the unique id assigned to the object, thus one object will return the same id every time. However, a copy of that object with the same value but stored in a different place will return a different id. In addition, the <b><code>is</code></b> operator compares the identity of two variables and returns <b><code>True</code></b> if they reference the same object!\n"
131135
]
@@ -325,7 +329,11 @@
325329
"source": [
326330
"And here's a small illustration of what happened:\n",
327331
"\n",
328-
"![image.png](https://raw.githubusercontent.com/mike-mendoza/Bivariate_NPBN_workshop_files/main/files_pyhton_book_test/02.png)\n",
332+
"```{image} 02.png\n",
333+
":alt: rectangle\n",
334+
":width: 800px\n",
335+
":align: center\n",
336+
"```\n",
329337
"\n",
330338
"So, as you can see — this confusion is not a big deal for immutable objects. However, it should still be explained what you should do in this situation with the mutable objects. How could you assign values of one list to another list? First, you can just write a for loop and copy the lower level data, which is immutable, with the <b><code>=</code></b> operator.\n",
331339
"\n",

book/05/Exercises/02.ipynb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@
2626
"A 12 m span bridge is modelled as 1D continuous simply supported beam. The bridge is subjected to the axle loads ($A$) of 3-axle vehicle, as shown in the figure bellow. The largest axle load will generally cause the maximum bending bending moment ($M_{max}$) under its location $p$.\n",
2727
"\n",
2828
"\n",
29-
"<p><img src=\"https://raw.githubusercontent.com/TUDelft-CITG/learn-python/mike/book/05/Exercises/02_01.png\" alt=\"\" style=\"display: block; margin-left: auto; margin-right: auto;\" width=\"500\" height=\"330\" /></p>\n",
30-
"\n",
29+
"```{image} 02_01.png\n",
30+
":alt: rectangle\n",
31+
":width: 800px\n",
32+
":align: center\n",
33+
"```\n",
3134
"\n",
3235
"For this particular vehicle characteristics, i.e., $A_1 \\leq A_3 \\leq A_2$ and $ D_2 \\leq D_1 \\leq a$. $M_{max}$ can be computed as follows:\n",
3336
" \n",

book/06/Theory/01.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2669,7 +2669,11 @@
26692669
"\n",
26702670
"<b><code>pandas</code></b> provides many functions to import data into <b><code>dataframes</code></b>, such as <b><code>read_csv()</code></b> to read delimited text files, or <b><code>read_excel()</code></b> for Excel or OpenDocument spreadsheets. <b><code>read_csv()</code></b> provides options that allow you to filter the data, such as specifying the separator/delimiter, the lines that form the headers, which rows to skip, etc. Let's analyze the <b><code>mineral_properties.txt</code></b>. Below a screenshot of it:<br><br>\n",
26712671
" \n",
2672-
"![image.png](01.png)"
2672+
"```{image} 01.png\n",
2673+
":alt: rectangle\n",
2674+
":width: 400px\n",
2675+
":align: center\n",
2676+
"```"
26732677
]
26742678
},
26752679
{

book/07/Exercises/01.ipynb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@
4747
"* legend font size = 10\n",
4848
"* dashed grid placed behind the histogram\n",
4949
"\n",
50-
"<p><img src=\"https://raw.githubusercontent.com/TUDelft-CITG/learn-python/mike/book/07/Exercises/01.png\" alt=\"\" style=\"display: block; margin-left: auto; margin-right: auto;\" width=\"500\" height=\"312\" /></p>\n",
51-
"\n"
50+
"```{image} 01.png\n",
51+
":alt: rectangle\n",
52+
":width: 400px\n",
53+
":align: center\n",
54+
"```"
5255
]
5356
},
5457
{
@@ -103,7 +106,11 @@
103106
"* title font size = 14\n",
104107
"* x and y labels font size = 12\n",
105108
"\n",
106-
"<p><img src=\"https://raw.githubusercontent.com/TUDelft-CITG/learn-python/mike/book/07/Exercises/02.png\" alt=\"\" style=\"display: block; margin-left: auto; margin-right: auto;\" width=\"500\" height=\"312\" /></p>\n"
109+
"```{image} 02.png\n",
110+
":alt: rectangle\n",
111+
":width: 400px\n",
112+
":align: center\n",
113+
"```"
107114
]
108115
},
109116
{
@@ -156,7 +163,11 @@
156163
"* Scatter plot with marginal histograms representing the Axle 1 and Axle 2 measurements\n",
157164
"* x and y labels font size = 14\n",
158165
"\n",
159-
"<p><img src=\"https://raw.githubusercontent.com/TUDelft-CITG/learn-python/mike/book/07/Exercises/03.png\" alt=\"\" style=\"display: block; margin-left: auto; margin-right: auto;\" width=\"400\" height=\"400\" /></p>\n"
166+
"```{image} 03.png\n",
167+
":alt: rectangle\n",
168+
":width: 400px\n",
169+
":align: center\n",
170+
"```"
160171
]
161172
},
162173
{

0 commit comments

Comments
 (0)