Ejemplo 1: Python agrega una línea vertical en la trama
# Basic syntax:
plt.axvline(x_coordinate)
# Example usage:
import matplotlib.pyplot as plt
plt.figure(figsize=(5, 5))
plt.axvline(x=10, ymin=0.10, ymax=0.70, color='b', ls='--', lw=1.5, label='axvline - % of full height')
plt.legend(bbox_to_anchor=(1.0, 1), loc='best')
plt.show()
# Where:
# - x is the x axis coordinate for the vertical line
# - ymin is the minimum y-value to show
# - ymax is the maximum y-value to show
# - ls is the line style (see also '-', '-.', and ':')
# - lw is the line width
Ejemplo 2: línea vertical en matplotlib
xposition = [0.3, 0.4, 0.45]
for xc in xposition:
plt.axvline(x=xc, color='k', linestyle='--')
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)