2011-03-21 12 views

Respuesta

1

El código de ejemplo en la documentación oficial de matplotlib puede oscurecer las cosas un poco si alguien solo necesita un trimestre de medio simple. Escribí un fragmento de código que puede ayudar a alguien que no está familiarizado con AxisArtistshere.

The output image of this code snippet

+0

Por favor, no proporcionan sólo enlace answe rs. En lugar de eso, publica tu código aquí. – ImportanceOfBeingErnest

1

las siguientes obras en matplotlib 2.1 o superior. También hay an example en la página matplotlib.
Puede usar un diagrama polar usual, ax = fig.add_subplot(111, polar=True) y limitar el rango theta. Para una medio gráfico polar

ax.set_thetamin(0) 
ax.set_thetamax(180) 

o para un gráfico polar trimestre

ax.set_thetamin(0) 
ax.set_thetamax(90) 

Ejemplo completo:

import matplotlib.pyplot as plt 
import numpy as np 

theta = np.linspace(0,np.pi) 
r = np.sin(theta) 

fig = plt.figure() 
ax = fig.add_subplot(111, polar=True) 
c = ax.scatter(theta, r, c=r, s=10, cmap='hsv', alpha=0.75) 

ax.set_thetamin(0) 
ax.set_thetamax(180) 

plt.show() 

enter image description here

Cuestiones relacionadas