2016-04-12 16:08:29 +02:00
|
|
|
\begin{juliacode}
|
|
|
|
using PyPlot
|
2014-12-09 14:32:41 +01:00
|
|
|
x = linspace(0, 2π, 200)
|
|
|
|
plot(x, sin(x))
|
|
|
|
\end{juliacode}
|
2016-04-27 20:24:44 +02:00
|
|
|
\begin{juliaout}
|
|
|
|
1-element Array{Any,1}:
|
2017-03-13 15:12:57 +01:00
|
|
|
PyObject <matplotlib.lines.Line2D object at 0x7fbd66371c50>
|
2016-04-27 20:24:44 +02:00
|
|
|
\end{juliaout}
|
2016-04-12 16:08:29 +02:00
|
|
|
\begin{figure}[ht]
|
|
|
|
\center
|
|
|
|
\includegraphics[width=\linewidth]{figures/pyplot_formats_sin_fun_1.pdf}
|
|
|
|
\caption{sin(x) function.}
|
|
|
|
\label{fig:sin_fun}
|
|
|
|
\end{figure}
|
2014-12-09 14:32:41 +01:00
|
|
|
|
2016-04-27 20:24:44 +02:00
|
|
|
\begin{juliaout}
|
|
|
|
1-element Array{Any,1}:
|
2017-03-13 15:12:57 +01:00
|
|
|
PyObject <matplotlib.lines.Line2D object at 0x7fbd66325a20>
|
2016-04-27 20:24:44 +02:00
|
|
|
\end{juliaout}
|
2016-04-12 16:08:29 +02:00
|
|
|
\begin{figure}[htpb]
|
|
|
|
\center
|
|
|
|
\includegraphics[width=\linewidth]{figures/pyplot_formats_2_1.pdf}
|
|
|
|
\caption{cos(x) function.}
|
|
|
|
\end{figure}
|
2014-12-09 14:32:41 +01:00
|
|
|
|
2016-04-27 20:24:44 +02:00
|
|
|
\begin{juliaout}
|
|
|
|
1-element Array{Any,1}:
|
2017-03-13 15:12:57 +01:00
|
|
|
PyObject <matplotlib.lines.Line2D object at 0x7fbd6629cf28>
|
2016-04-27 20:24:44 +02:00
|
|
|
\end{juliaout}
|
2016-04-12 16:08:29 +02:00
|
|
|
\includegraphics[width=\linewidth]{figures/pyplot_formats_cos2_fun_1.pdf}
|
2014-12-09 14:32:41 +01:00
|
|
|
|
|
|
|
\begin{juliaterm}
|
|
|
|
julia> x = linspace(0, 2π, 200)
|
2016-11-01 14:23:14 +01:00
|
|
|
200-element LinSpace{Float64}:
|
|
|
|
0.0,0.0315738,0.0631476,0.0947214,0.126295,…,6.18846,6.22004,6.25161,6.28319
|
2014-12-09 14:32:41 +01:00
|
|
|
|
2017-03-13 15:12:57 +01:00
|
|
|
julia> plot(x, sin(x))
|
2016-04-11 21:08:41 +02:00
|
|
|
1-element Array{Any,1}:
|
2017-03-13 15:12:57 +01:00
|
|
|
PyObject <matplotlib.lines.Line2D object at 0x7fbd600ca588>
|
2014-12-09 14:32:41 +01:00
|
|
|
|
2017-03-13 15:12:57 +01:00
|
|
|
julia> y = 20
|
2016-04-11 21:08:41 +02:00
|
|
|
20
|
2017-03-13 15:12:57 +01:00
|
|
|
|
2014-12-09 14:32:41 +01:00
|
|
|
julia> plot(x, cos(x))
|
|
|
|
1-element Array{Any,1}:
|
2017-03-13 15:12:57 +01:00
|
|
|
PyObject <matplotlib.lines.Line2D object at 0x7fbd600f4c18>
|
|
|
|
|
2014-12-09 14:32:41 +01:00
|
|
|
\end{juliaterm}
|
2016-04-12 16:08:29 +02:00
|
|
|
\includegraphics[width=\linewidth]{figures/pyplot_formats_4_1.pdf}
|
2014-12-09 14:32:41 +01:00
|
|
|
|
2016-04-12 16:08:29 +02:00
|
|
|
\begin{juliacode}
|
|
|
|
x = randn(100, 100)
|
2014-12-09 14:32:41 +01:00
|
|
|
contourf(x)
|
|
|
|
\end{juliacode}
|
2016-04-27 20:24:44 +02:00
|
|
|
\begin{juliaout}
|
2017-03-13 15:12:57 +01:00
|
|
|
PyObject <matplotlib.contour.QuadContourSet object at 0x7fbd600ba9b0>
|
2016-04-27 20:24:44 +02:00
|
|
|
\end{juliaout}
|
2016-04-12 16:08:29 +02:00
|
|
|
\includegraphics[width=15cm]{figures/pyplot_formats_5_1.pdf}
|