Skip to content

Commit

Permalink
updated docs with lineplot example
Browse files Browse the repository at this point in the history
  • Loading branch information
CDonnerer committed Jan 30, 2021
1 parent d0da940 commit 5f88ec7
Showing 1 changed file with 36 additions and 28 deletions.
64 changes: 36 additions & 28 deletions docs/examples/basic_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,40 +99,48 @@ using a similar syntax to `matplotlib`_. E.g. we could modify the above call to

Please refer to :ref:`api_reference` for the full list of possible options.

Multiple scatters can be plotted by using 2d arrays::

Multiple series
-------------------

Multiple series can be plotted by providing 2d arrays to the plot function::


>>> import numpy as np
>>> import shellplot as plt
>>> x1 = np.arange(-3, 6, 0.01)
>>> x = np.arange(-3, 6, 0.01)
>>> y1 = np.cos(x)
>>> y2 = np.sin(x)
>>> x, y = np.vstack((x1, x1)), np.vstack((y1, y2))
>>> plt.plot(x, y, label=("cos", "sin"), figsize=(61, 21))

1.0┤ +++++ ****** +
| +++ +++ ** ** +++
| ++ ++** ** ++
| ++ ** ** ++
| ++ **++ ** ++
0.5┤ + ** + ** +
| ++ ** ++ ** +
| ++ * ++ * ++
| + ** + ** ++
| + ** + ** +
0.0┤ ++ * ++ * ++
|* + ** + ** ++
|** + ** + ** +
| * ++ * ++ * ++ *
| ** ++ ** ++ ** ++ *
-0.5┤ ** + ** + ** + **
| **++ ** ++ **++ **
| ** ** ++ ** **
| ++** ** ++ ++** **
| +++ ** ** +++ +++ ** ** + cos
-1.0┤++ ****** +++++ ***** * sin
└┬------------┬-------------┬------------┬------------┬-------
-3 -1 1 3 5
>>> x, y = np.vstack((x, x)), np.vstack((y1, y2))
>>> plt.plot(x, y, line=True, label=("cos", "sin"), figsize=(70, 25))

1.0┤ ·+· ·*··*
| ·+ +· * ·
| +· ·+ · * +
| * · ··
| · · * +
| + * + ·
0.5┤ · · · · ·
| · * +
| + * + ·
| · ·
| · · · *
| + + +
0.0┤ * · · ·
| ·
|* · · * ·
| + + · +
| · · * · · ·
| * · *
-0.5┤ · + · + · +
| · * *
| *· · · *· ··
| +· * + +· *
| ·· * · ·· · * ·
| + · ·* + ·+ · * + cos
-1.0┤+· *·*· ·+·+· *··*· * sin
└┬--------------┬---------------┬--------------┬--------------┬--------
-3 -1 1 3 5



Expand Down

0 comments on commit 5f88ec7

Please sign in to comment.