In [1]:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 5, 11)
y = x ** 2
%matplotlib inline
In [28]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=3,)
Out[28]:
In [29]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=3,marker="+")
Out[29]:
In [4]:
x
Out[4]:
In [5]:
y
Out[5]:
In [30]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=3,marker="*")
Out[30]:
In [31]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=3,marker="o")
Out[31]:
In [10]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=3,marker="+")
Out[10]:
In [32]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=.1,marker="1")
Out[32]:
In [33]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=1,marker="1",markersize=8)
Out[33]:
In [34]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=1,marker="2",markersize=18)
Out[34]:
In [35]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=1,marker="3",markersize=18)
Out[35]:
In [20]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=1,marker="4",markersize=18)
Out[20]:
In [36]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=1,marker="o",markersize=18)
Out[36]:
In [22]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=1,marker="o",markersize=18,
markerfacecolor="red")
Out[22]:
In [37]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="#808000" ,lw=1,marker="o",markersize=18,
markerfacecolor="g")
Out[37]:
In [38]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="b" ,lw=1,marker="o",markersize=18,
markerfacecolor="g",markeredgewidth=3)
Out[38]:
In [39]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,color="b" ,lw=1,marker="o",markersize=18,
markerfacecolor="g",markeredgewidth=3,markeredgecolor="r")
Out[39]:
In [27]:
fig, ax = plt.subplots(figsize=(12,6))
ax.plot(x, x+1, color="red", linewidth=0.25)
ax.plot(x, x+2, color="red", linewidth=0.50)
ax.plot(x, x+3, color="red", linewidth=1.00)
ax.plot(x, x+4, color="red", linewidth=2.00)
# possible linestype options ‘-‘, ‘–’, ‘-.’, ‘:’, ‘steps’
ax.plot(x, x+5, color="green", lw=3, linestyle='-')
ax.plot(x, x+6, color="green", lw=3, ls='-.')
ax.plot(x, x+7, color="green", lw=3, ls=':')
# custom dash
line, = ax.plot(x, x+8, color="black", lw=1.50)
line.set_dashes([5, 10, 15, 10]) # format: line length, space length, ...
# possible marker symbols: marker = '+', 'o', '*', 's', ',', '.', '1', '2', '3', '4', ...
ax.plot(x, x+ 9, color="blue", lw=3, ls='-', marker='+')
ax.plot(x, x+10, color="blue", lw=3, ls='--', marker='o')
ax.plot(x, x+11, color="blue", lw=3, ls='-', marker='s')
ax.plot(x, x+12, color="blue", lw=3, ls='--', marker='1')
# marker size and color
ax.plot(x, x+13, color="purple", lw=1, ls='-', marker='o', markersize=2)
ax.plot(x, x+14, color="purple", lw=1, ls='-', marker='o', markersize=4)
ax.plot(x, x+15, color="purple", lw=1, ls='-', marker='o', markersize=8, markerfacecolor="red")
ax.plot(x, x+16, color="purple", lw=1, ls='-', marker='s', markersize=8,
markerfacecolor="yellow", markeredgewidth=3, markeredgecolor="green");
No comments:
Post a Comment