Gadfly的水平轴范围

时间:2020-03-04 05:01:05

标签: plot julia gadfly

我使用以下代码在Gadfly中使用Julia生成图形:

var button = document.createElement("Button");
button.innerHTML = "Title";
button.style = "top:15px;left:15px;position:absolute;z-index:99999; width:50px; height 50px; background_color; ff0000";
button.onclick = () => alert('Test Alert');
document.body.appendChild(button);

这是我得到的图形:

sine

由于末尾有空白,因此水平轴调整不正确。但是,如果水平轴的指示边界是整数,则没有空格。考虑以下示例:

using Gadfly, Cairo, Fontconfig
p = plot(sin, 0, pi)
p |> PNG("sin_pi.png", 6inch, 4inch)

enter image description here

我想这只是一个错误,但是我对Julia和Gadfly完全陌生,所以我不知道这是否是预期的行为。这是一个错误还是有办法调整水平轴范围的确定方式?

非常感谢您的帮助!

P.S。我在macOS 10.15.3上使用Julia v1.3.1和Gadfly v1.2.0。如果我只使用

,结果是一样的
using Gadfly, Cairo, Fontconfig
p = plot(sin, 0, 4)
p |> PNG("sin_4.png", 6inch, 4inch)

但是我不确定是否有简单的方法可以将SVG文件合并到我的问题中。

1 个答案:

答案 0 :(得分:1)

Gadfly文档中有一个示例:http://gadflyjl.org/stable/gallery/coordinates/