Verified Commit 28d6a97c authored by Renato Alves's avatar Renato Alves 🌱
Browse files

Show case of plot() without line

parent 127ba05e
......@@ -561,11 +561,17 @@ x = np.linspace(0, 2, 10) # We reduce the number of samples
plt.plot(x, x, "o-b", label='linear') # full circles and continuous line in blue
plt.plot(x, x**2, "v--r", label='quadratic') # down pointing triangles a dashed line in red
plt.plot(x, x**3, "*-.g", label='cubic') # starts with dot dashed line in green
plt.plot(x, x**4, ".m", label='quadric') # points without a connecting line in magenta
~~~
{: .language-python }
![custom marker line color plot](../fig/my-custom-marker-line-color.png)
Although the aesthetic aspect could still benefit from additional changes,
we can see how we can conveniently modify the style of the plot.
Notice also that in the `quadric` case, omitting the `line` part of the formatting
style, disables drawing a connecting line.
> ## Point and scatter
>
> `matplotlib` includes also a [`scatter()` function][matplotlib-scatter]
......
fig/my-custom-marker-line-color.png

29.6 KB | W: | H:

fig/my-custom-marker-line-color.png

29.4 KB | W: | H:

fig/my-custom-marker-line-color.png
fig/my-custom-marker-line-color.png
fig/my-custom-marker-line-color.png
fig/my-custom-marker-line-color.png
  • 2-up
  • Swipe
  • Onion skin
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