From 071b53b25d652a7f0326929639e9c64ac7e9ce9b Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 7 Oct 2021 23:27:02 +0200 Subject: [PATCH 1/2] DOC: Minimal getting started page --- doc/_static/mpl.css | 14 +++++++++ doc/users/getting_started.rst | 54 +++++++++++++++++++++++++++++++++++ doc/users/index.rst | 1 + 3 files changed, 69 insertions(+) create mode 100644 doc/users/getting_started.rst diff --git a/doc/_static/mpl.css b/doc/_static/mpl.css index 5f62cd3c95c7..370e2e5ac201 100644 --- a/doc/_static/mpl.css +++ b/doc/_static/mpl.css @@ -231,3 +231,17 @@ table.property-table td { /* fix width to width of cheatsheet */ width: 210px; } + +/* Two columns for install code blocks */ +div.twocol { + padding-left: 0; + padding-right: 0; + display: flex; + gap: 20px; +} + +div.twocol > div { + flex-grow: 1; + padding: 0; + margin: 0; +} diff --git a/doc/users/getting_started.rst b/doc/users/getting_started.rst new file mode 100644 index 000000000000..915d27fa8b8a --- /dev/null +++ b/doc/users/getting_started.rst @@ -0,0 +1,54 @@ +Getting started +=============== + +Installation +------------ + +.. container:: twocol + + .. container:: + + Install using pip: + + .. code-block:: bash + + pip install matplotlib + + .. container:: + + Install using conda: + + .. code-block:: bash + + conda install matplotlib + +Further details are available in the :doc:`Installation Guide `. + + +Draw a first plot +----------------- + +Here is a minimal example plot you can try out: + +.. plot:: + :include-source: + :align: center + + import matplotlib.pyplot as plt + import numpy as np + + x = np.linspace(0, 2 * np.pi, 200) + y = np.sin(x) + + fig, ax = plt.subplots() + ax.plot(x, y) + plt.show() + + +Where to go next +---------------- + +- Check out :doc:`Plot types ` to get an overview of the + types of plots you can to with Matplotlib. +- Learn Matplotlib from the ground up in the + :doc:`Quick-start guide `. diff --git a/doc/users/index.rst b/doc/users/index.rst index fd3bec7dfcdd..f3ca47bf82ac 100644 --- a/doc/users/index.rst +++ b/doc/users/index.rst @@ -10,6 +10,7 @@ Usage guide ../plot_types/index.rst ../tutorials/index.rst ../gallery/index.rst + getting_started.rst explain.rst ../faq/index.rst ../api/index.rst From 0dce1f475ab5a0a7c92ed72bdeb9f82d9c7dc685 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 8 Oct 2021 13:51:15 +0200 Subject: [PATCH 2/2] Update doc/users/getting_started.rst Co-authored-by: hannah --- doc/users/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/getting_started.rst b/doc/users/getting_started.rst index 915d27fa8b8a..241f103f09be 100644 --- a/doc/users/getting_started.rst +++ b/doc/users/getting_started.rst @@ -49,6 +49,6 @@ Where to go next ---------------- - Check out :doc:`Plot types ` to get an overview of the - types of plots you can to with Matplotlib. + types of plots you can create with Matplotlib. - Learn Matplotlib from the ground up in the :doc:`Quick-start guide `.