Как повернуть маркеры заполнения-стиля matplotlib?

да, возможно, но попробуйте изменить свой код

@{ double totalPrice = 0;}

@foreach (var item in Model)
{

   totalPrice += item.Price;
}
@totalPrice;
2
задан pyano 18 January 2019 в 18:18
поделиться

1 ответ

Я не знаю, может ли это быть сделано с помощью маркеров или MarkerStyle, документация только указывает, как заполнить символ, деленный на половину. Вы можете имитировать это поведение, сложив вместе 2 полукруга и повернув их соответственно.

import matplotlib.pyplot as plt
import matplotlib as mpl

plt.figure(1)

x = [0,10,20,30,40,50,60,70,80,90]

ax=plt.gca()
rot=0

for i in x:

    HalfA=mpl.patches.Wedge((i, i+20), 5,theta1=0-rot,theta2=180-rot, color='r')
    HalfB=mpl.patches.Wedge((i, i+20), 5,theta1=180-rot,theta2=360-rot, color='b')

    rot=rot+360/len(x)

    ax.add_artist(HalfA)
    ax.add_artist(HalfB)

    ax.plot(i, i, marker=(2, 0, -i), c='k',markersize=30, linestyle='None')
    ax.plot(i, i, marker=(3, 0, -i), c='k',markersize=10, linestyle='None')


ax.set_xlim((-10, 110))
ax.set_ylim((-10, 130))

This is the output that I get

0
ответ дан rayryeng 18 January 2019 в 18:18
поделиться
Другие вопросы по тегам:

Похожие вопросы: