【问题标题】:How to color specific region of plot. SageMath如何为绘图的特定区域着色。贤者数学
【发布时间】:2021-10-13 19:30:44
【问题描述】:

我正在开始一个涉及 Hecke 三角形表面上的连续分数的项目,我想为半圆上方和两条垂直线之间的区域着色。我怎么能用 sagemath python 做到这一点?

from sage.plot.line import Line
var('x')
e = sqrt(1-x^2)
f = line([(-1/2, sqrt(3)/2), (-1/2, 3)])
g = line([(1/2, sqrt(3)/2), (1/2, 3)])

show(plot(e) + g + f, aspect_ratio=1)

【问题讨论】:

    标签: python sage


    【解决方案1】:

    我使用了 region_plot 并在半圆和线之间划定了区域。

    t = region_plot( y > sqrt(1-x^2), (x,-1/2,1/2), (y,-2,3), incol='red', 
    bordercol='gray')
    show(plot(e) + g + f + t, aspect_ratio=1)
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-03-12
    • 1970-01-01
    • 2021-12-29
    • 1970-01-01
    • 1970-01-01
    • 2016-11-20
    • 1970-01-01
    相关资源
    最近更新 更多