gpt4 book ai didi

haskell - Haskell 图中有容器类型吗?

转载 作者:行者123 更新时间:2023-12-03 23:08:42 25 4
gpt4 key购买 nike

我正在尝试在图表中绘制一些数据。我对图表完全陌生,但我本质上想要一个矩形,当我将其他图表放在它上面时它会增长。我已经搜索了文档,但没有找到任何内容。

是否存在这样的形状,或者知道缩放多少的方法?

最佳答案

如果您只需要围绕一些图表的矩形,boundingRect可能就够了。它可能看起来像这样(注意 pad 是完全可选的):

-- Arbitrary example, taken from the manual.
contents :: Diagram B
contents = c ||| hrule 1 ||| c
where
c = circle 1 <> vrule 2

-- Adding a bounding rectangle around it, with a little padding.
example :: Diagram B
example = contents <> bounds
where
bounds = boundingRect (contents # pad 1.1)
# lc red

关于haskell - Haskell 图中有容器类型吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60458714/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com