Commit 9f38ae74 authored by Greg Wilson's avatar Greg Wilson
Browse files

Converting all images to relative references to make HTTPS happy

parent 9e00489f
......@@ -156,7 +156,7 @@ weight in kilograms is now: 57.5
If we imagine the variable as a sticky note with a name written on it,
assignment is like putting the sticky note on a particular value:
![Variables as Sticky Notes]({{ site.github.url }}/fig/python-sticky-note-variables-01.svg)
![Variables as Sticky Notes](../fig/python-sticky-note-variables-01.svg)
This means that assigning a value to one variable does *not* change the values of other variables.
For example,
......@@ -173,7 +173,7 @@ weight in kilograms: 57.5 and in pounds: 126.5
~~~
{: .output}
![Creating Another Variable]({{ site.github.url }}/fig/python-sticky-note-variables-02.svg)
![Creating Another Variable](../fig/python-sticky-note-variables-02.svg)
and then change `weight_kg`:
......@@ -188,7 +188,7 @@ weight in kilograms is now: 100.0 and weight in pounds is still: 126.5
~~~
{: .output}
![Updating a Variable]({{ site.github.url }}/fig/python-sticky-note-variables-03.svg)
![Updating a Variable](../fig/python-sticky-note-variables-03.svg)
Since `weight_lb` doesn't "remember" where its value came from,
it isn't automatically updated when `weight_kg` changes.
......@@ -604,7 +604,7 @@ next diagram on the left), or the average for each day (as in the
diagram on the right)? As the diagram below shows, we want to perform the
operation across an axis:
![Operations Across Axes]({{ site.github.url }}/fig/python-operations-across-axes.png)
![Operations Across Axes](../fig/python-operations-across-axes.png)
To support this,
most array functions allow us to specify the axis we want to work on.
......@@ -680,7 +680,7 @@ matplotlib.pyplot.show()
~~~
{: .python}
![Heatmap of the Data]({{ site.github.url }}/fig/01-numpy_71_0.png)
![Heatmap of the Data](../fig/01-numpy_71_0.png)
Blue regions in this heat map are low values, while red shows high values.
As we can see,
......@@ -712,7 +712,7 @@ matplotlib.pyplot.show()
~~~
{: .python}
![Average Inflammation Over Time]({{ site.github.url }}/fig/01-numpy_73_0.png)
![Average Inflammation Over Time](../fig/01-numpy_73_0.png)
Here,
we have put the average per day across all patients in the variable `ave_inflammation`,
......@@ -729,7 +729,7 @@ matplotlib.pyplot.show()
~~~
{: .python}
![Maximum Value Along The First Axis]({{ site.github.url }}/fig/01-numpy_75_1.png)
![Maximum Value Along The First Axis](../fig/01-numpy_75_1.png)
~~~
min_plot = matplotlib.pyplot.plot(numpy.min(data, axis=0))
......@@ -737,7 +737,7 @@ matplotlib.pyplot.show()
~~~
{: .python}
![Minimum Value Along The First Axis]({{ site.github.url }}/fig/01-numpy_75_3.png)
![Minimum Value Along The First Axis](../fig/01-numpy_75_3.png)
The maximum value rises and falls perfectly smoothly,
while the minimum seems to be a step function.
......@@ -786,7 +786,7 @@ matplotlib.pyplot.show()
~~~
{: .python}
![The Previous Plots as Subplots]({{ site.github.url }}/fig/01-numpy_80_0.png)
![The Previous Plots as Subplots](../fig/01-numpy_80_0.png)
The [call](reference.html#function-call) to `loadtxt` reads our data,
and the rest of the program tells the plotting library
......
......@@ -19,7 +19,7 @@ In the last lesson,
we wrote some code that plots some values of interest from our first inflammation dataset,
and reveals some suspicious features in it, such as from `inflammation-01.csv`
![Analysis of inflammation-01.csv]({{ site.github.url }}/fig/03-loop_2_0.png)
![Analysis of inflammation-01.csv](../fig/03-loop_2_0.png)
We have a dozen data sets right now, though, and more on the way.
We want to create plots for all of our data sets with a single statement.
......@@ -144,7 +144,7 @@ for variable in collection:
Using the oxygen example above, the loop might look like this:
![loop_image]({{ site.github.url }}/fig/loops_image.png)
![loop_image](../fig/loops_image.png)
where each character (`char`) in the variable `word` is looped through and printed one character after another.
The numbers in the diagram denote which loop cycle the character was printed in (1 being the first loop, and 6 being the final loop).
......
......@@ -138,7 +138,7 @@ does not.
> Here is a visual example of how indexing a list of lists `x` works:
>
> <a href='https://twitter.com/hadleywickham/status/643381054758363136'>
> ![The first element of a list. Adapted from @hadleywickham's tweet about R lists.]({{ site.github.url }}/fig/indexing_lists_python.png)</a>
> ![The first element of a list. Adapted from @hadleywickham's tweet about R lists.](../fig/indexing_lists_python.png)</a>
>
> Using the previously declared list `x`, these would be the results of the
> index operations shown in the image:
......
......@@ -81,21 +81,21 @@ inflammation-01.csv
~~~
{: .output}
![Analysis of inflammation-01.csv]({{ site.github.url }}/fig/03-loop_49_1.png)
![Analysis of inflammation-01.csv](../fig/03-loop_49_1.png)
~~~
inflammation-02.csv
~~~
{: .output}
![Analysis of inflammation-02.csv]({{ site.github.url }}/fig/03-loop_49_3.png)
![Analysis of inflammation-02.csv](../fig/03-loop_49_3.png)
~~~
inflammation-03.csv
~~~
{: .output}
![Analysis of inflammation-03.csv]({{ site.github.url }}/fig/03-loop_49_5.png)
![Analysis of inflammation-03.csv](../fig/03-loop_49_5.png)
Sure enough,
the maxima of the first two data sets show exactly the same ramp as the first,
......
......@@ -52,7 +52,7 @@ If the test is false,
the body of the `else` is executed instead.
Only one or the other is ever executed:
![Executing a Conditional]({{ site.github.url }}/fig/python-flowchart-conditional.png)
![Executing a Conditional](../fig/python-flowchart-conditional.png)
Conditional statements don't have to include an `else`.
If there isn't one,
......
......@@ -50,7 +50,7 @@ def fahr_to_kelvin(temp):
~~~
{: .python}
![The Blueprint for a Python Function]({{ site.github.url }}/fig/python-function.svg)
![The Blueprint for a Python Function](../fig/python-function.svg)
<!--- see https://gist.github.com/wd15/2b4ffbe5ce0d0ddb8a5b to
regenerate the above figure --->
......
......@@ -263,7 +263,7 @@ The range of each time series is represented as a pair of numbers,
which are the time the interval started and ended.
The output is the largest range that they all include:
![Overlapping Ranges]({{ site.github.url }}/fig/python-overlapping-ranges.svg)
![Overlapping Ranges](../fig/python-overlapping-ranges.svg)
Most novice programmers would solve this problem like this:
......
......@@ -33,7 +33,7 @@ final = fahr_to_celsius(original)
The diagram below shows what memory looks like after the first line has been executed:
![Call Stack (Initial State)]({{ site.github.url }}/fig/python-call-stack-01.svg)
![Call Stack (Initial State)](../fig/python-call-stack-01.svg)
When we call `fahr_to_celsius`,
Python *doesn't* create the variable `temp` right away.
......@@ -43,12 +43,12 @@ to keep track of the variables defined by `fahr_to_kelvin`.
Initially,
this stack frame only holds the value of `temp`:
![Call Stack Immediately After First Function Call]({{ site.github.url }}/fig/python-call-stack-02.svg)
![Call Stack Immediately After First Function Call](../fig/python-call-stack-02.svg)
When we call `fahr_to_kelvin` inside `fahr_to_celsius`,
Python creates another stack frame to hold `fahr_to_kelvin`'s variables:
![Call Stack During First Nested Function Call]({{ site.github.url }}/fig/python-call-stack-03.svg)
![Call Stack During First Nested Function Call](../fig/python-call-stack-03.svg)
It does this because there are now two variables in play called `temp`:
the parameter to `fahr_to_celsius`,
......@@ -61,18 +61,18 @@ When the call to `fahr_to_kelvin` returns a value,
Python throws away `fahr_to_kelvin`'s stack frame
and creates a new variable in the stack frame for `fahr_to_celsius` to hold the temperature in Kelvin:
![Call Stack After Return From First Nested Function Call]({{ site.github.url }}/fig/python-call-stack-04.svg)
![Call Stack After Return From First Nested Function Call](../fig/python-call-stack-04.svg)
It then calls `kelvin_to_celsius`,
which means it creates a stack frame to hold that function's variables:
![Call Stack During Call to Second Nested Function]({{ site.github.url }}/fig/python-call-stack-05.svg)
![Call Stack During Call to Second Nested Function](../fig/python-call-stack-05.svg)
Once again,
Python throws away that stack frame when `kelvin_to_celsius` is done
and creates the variable `result` in the stack frame for `fahr_to_celsius`:
![Call Stack After Second Nested Function Returns]({{ site.github.url }}/fig/python-call-stack-06.svg)
![Call Stack After Second Nested Function Returns](../fig/python-call-stack-06.svg)
Finally,
when `fahr_to_celsius` is done,
......@@ -80,7 +80,7 @@ Python throws away *its* stack frame
and puts its result in a new variable called `final`
that lives in the stack frame we started with:
![Call Stack After All Functions Have Finished]({{ site.github.url }}/fig/python-call-stack-07.svg)
![Call Stack After All Functions Have Finished](../fig/python-call-stack-07.svg)
This final stack frame is always there;
it holds the variables we defined outside the functions in our code.
......@@ -200,7 +200,7 @@ grid.show()
~~~
{: .python}
![]({{ site.github.url }}/fig/grid-01.png)
![](../fig/grid-01.png)
Just like a NumPy array,
an `ImageGrid` has some properties that hold information about it:
......@@ -228,7 +228,7 @@ RGB is an [additive color model](reference.html#additive-color-model):
every shade is some combination of red, green, and blue intensities.
We can think of these three values as being the axes in a cube:
![RGB Color Cube]({{ site.github.url }}/fig/color-cube.png)
![RGB Color Cube](../fig/color-cube.png)
An RGB color is an example of a multi-part value:
like a Cartesian coordinate,
......@@ -310,7 +310,7 @@ row.show()
~~~
{: .python}
![]({{ site.github.url }}/fig/grid-02.png)
![](../fig/grid-02.png)
Simple color values like `(0,255,0)` are easy enough to decipher with a bit of practice,
but what color is `(214,90,127)`?
......@@ -323,7 +323,7 @@ show_color(214, 90, 127)
~~~
{: .python}
![]({{ site.github.url }}/fig/ipythonblocks_show_color_example.png)
![](../fig/ipythonblocks_show_color_example.png)
It also provides a table of standard colors:
......@@ -340,7 +340,7 @@ c.show()
~~~
{: .python}
![]({{ site.github.url }}/fig/grid-03.png)
![](../fig/grid-03.png)
> ## Making a Colorbar
>
......
<p><img alt="Variables as Sticky Notes" src="{{ site.github.url }}/fig/python-sticky-note-variables-01.svg" /></p>
<p><img alt="Variables as Sticky Notes" src="../fig/python-sticky-note-variables-01.svg" /></p>
<hr/>
<p><img alt="Creating Another Variable" src="{{ site.github.url }}/fig/python-sticky-note-variables-02.svg" /></p>
<p><img alt="Creating Another Variable" src="../fig/python-sticky-note-variables-02.svg" /></p>
<hr/>
<p><img alt="Updating a Variable" src="{{ site.github.url }}/fig/python-sticky-note-variables-03.svg" /></p>
<p><img alt="Updating a Variable" src="../fig/python-sticky-note-variables-03.svg" /></p>
<hr/>
<p><img alt="Operations Across Axes" src="{{ site.github.url }}/fig/python-operations-across-axes.png" /></p>
<p><img alt="Operations Across Axes" src="../fig/python-operations-across-axes.png" /></p>
<hr/>
<p><img alt="Heatmap of the Data" src="{{ site.github.url }}/fig/01-numpy_71_0.png" /></p>
<p><img alt="Heatmap of the Data" src="../fig/01-numpy_71_0.png" /></p>
<hr/>
<p><img alt="Average Inflammation Over Time" src="{{ site.github.url }}/fig/01-numpy_73_0.png" /></p>
<p><img alt="Average Inflammation Over Time" src="../fig/01-numpy_73_0.png" /></p>
<hr/>
<p><img alt="Maximum Value Along The First Axis" src="{{ site.github.url }}/fig/01-numpy_75_1.png" /></p>
<p><img alt="Maximum Value Along The First Axis" src="../fig/01-numpy_75_1.png" /></p>
<hr/>
<p><img alt="Minimum Value Along The First Axis" src="{{ site.github.url }}/fig/01-numpy_75_3.png" /></p>
<p><img alt="Minimum Value Along The First Axis" src="../fig/01-numpy_75_3.png" /></p>
<hr/>
<p><img alt="The Previous Plots as Subplots" src="{{ site.github.url }}/fig/01-numpy_80_0.png" /></p>
<p><img alt="The Previous Plots as Subplots" src="../fig/01-numpy_80_0.png" /></p>
<hr/>
<p><img alt="Analysis of inflammation-01.csv" src="{{ site.github.url }}/fig/03-loop_2_0.png" /></p>
<p><img alt="Analysis of inflammation-01.csv" src="../fig/03-loop_2_0.png" /></p>
<hr/>
<p><img alt="loop_image" src="{{ site.github.url }}/fig/loops_image.png" /></p>
<p><img alt="loop_image" src="../fig/loops_image.png" /></p>
<hr/>
<p><img alt="The first element of a list. Adapted from @hadleywickham's tweet about R lists." src="{{ site.github.url }}/fig/indexing_lists_python.png" /></p>
<p><img alt="The first element of a list. Adapted from @hadleywickham's tweet about R lists." src="../fig/indexing_lists_python.png" /></p>
<hr/>
<p><img alt="Analysis of inflammation-01.csv" src="{{ site.github.url }}/fig/03-loop_49_1.png" /></p>
<p><img alt="Analysis of inflammation-01.csv" src="../fig/03-loop_49_1.png" /></p>
<hr/>
<p><img alt="Analysis of inflammation-02.csv" src="{{ site.github.url }}/fig/03-loop_49_3.png" /></p>
<p><img alt="Analysis of inflammation-02.csv" src="../fig/03-loop_49_3.png" /></p>
<hr/>
<p><img alt="Analysis of inflammation-03.csv" src="{{ site.github.url }}/fig/03-loop_49_5.png" /></p>
<p><img alt="Analysis of inflammation-03.csv" src="../fig/03-loop_49_5.png" /></p>
<hr/>
<p><img alt="Executing a Conditional" src="{{ site.github.url }}/fig/python-flowchart-conditional.png" /></p>
<p><img alt="Executing a Conditional" src="../fig/python-flowchart-conditional.png" /></p>
<hr/>
<p><img alt="The Blueprint for a Python Function" src="{{ site.github.url }}/fig/python-function.svg" /></p>
<p><img alt="The Blueprint for a Python Function" src="../fig/python-function.svg" /></p>
<hr/>
<p><img alt="Overlapping Ranges" src="{{ site.github.url }}/fig/python-overlapping-ranges.svg" /></p>
<p><img alt="Overlapping Ranges" src="../fig/python-overlapping-ranges.svg" /></p>
<hr/>
<p><img alt="Call Stack (Initial State)" src="{{ site.github.url }}/fig/python-call-stack-01.svg" /></p>
<p><img alt="Call Stack (Initial State)" src="../fig/python-call-stack-01.svg" /></p>
<hr/>
<p><img alt="Call Stack Immediately After First Function Call" src="{{ site.github.url }}/fig/python-call-stack-02.svg" /></p>
<p><img alt="Call Stack Immediately After First Function Call" src="../fig/python-call-stack-02.svg" /></p>
<hr/>
<p><img alt="Call Stack During First Nested Function Call" src="{{ site.github.url }}/fig/python-call-stack-03.svg" /></p>
<p><img alt="Call Stack During First Nested Function Call" src="../fig/python-call-stack-03.svg" /></p>
<hr/>
<p><img alt="Call Stack After Return From First Nested Function Call" src="{{ site.github.url }}/fig/python-call-stack-04.svg" /></p>
<p><img alt="Call Stack After Return From First Nested Function Call" src="../fig/python-call-stack-04.svg" /></p>
<hr/>
<p><img alt="Call Stack During Call to Second Nested Function" src="{{ site.github.url }}/fig/python-call-stack-05.svg" /></p>
<p><img alt="Call Stack During Call to Second Nested Function" src="../fig/python-call-stack-05.svg" /></p>
<hr/>
<p><img alt="Call Stack After Second Nested Function Returns" src="{{ site.github.url }}/fig/python-call-stack-06.svg" /></p>
<p><img alt="Call Stack After Second Nested Function Returns" src="../fig/python-call-stack-06.svg" /></p>
<hr/>
<p><img alt="Call Stack After All Functions Have Finished" src="{{ site.github.url }}/fig/python-call-stack-07.svg" /></p>
<p><img alt="Call Stack After All Functions Have Finished" src="../fig/python-call-stack-07.svg" /></p>
<hr/>
<p><img alt="" src="{{ site.github.url }}/fig/grid-01.png" /></p>
<p><img alt="" src="../fig/grid-01.png" /></p>
<hr/>
<p><img alt="RGB Color Cube" src="{{ site.github.url }}/fig/color-cube.png" /></p>
<p><img alt="RGB Color Cube" src="../fig/color-cube.png" /></p>
<hr/>
<p><img alt="" src="{{ site.github.url }}/fig/grid-02.png" /></p>
<p><img alt="" src="../fig/grid-02.png" /></p>
<hr/>
<p><img alt="" src="{{ site.github.url }}/fig/ipythonblocks_show_color_example.png" /></p>
<p><img alt="" src="../fig/ipythonblocks_show_color_example.png" /></p>
<hr/>
<p><img alt="" src="{{ site.github.url }}/fig/grid-03.png" /></p>
<p><img alt="" src="../fig/grid-03.png" /></p>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment