julia - 在 Julia 中绘制函数
问题描述
我正在尝试在 Julia 中绘制一个函数,但不断出现错误。我不明白出了什么问题。$\varphi$ 的输入和输出是一个标量。我用过x=1530:1545
,还是报错——谁能赐教?我很困扰。
编辑:
我稍作修改就可以使用它-我更改
x = 1530:1545
了添加以下两行
y = t.(x)
plot(x,y)
为什么我必须这样做?
解决方案
此功能目前在 中不可用PyPlots.jl
,如果您以后想拥有它,最好的办法是提交问题。但是,您可以通过Plots.jl
并将PyPlot
其用作后端来获得该功能。它看起来像这样(我将采用一个更简单的函数):
using Plots
pyplot()
start_point = 0
end_point = 10
plot_range = start_point:end_point
plot(sqrt,plot_range) # if you want the function exactly at 0,1,2,3...
plot(plot_range,sqrt) # works the same
plot(sqrt,start_point,end_point) # automatically chooses the interior points
推荐阅读
- reactjs - Reactjs 路由器无法获取 /page
- java - 使用多个 Java 类的 React-Native
- sql-server - 如何在 SQL Server 中处理字符串列表
- php - 提交后:PHP 致命错误:C:\xampp\htdocs\ 中找不到类
- c# - 在不替换 Oracle 中的空值的情况下进行 MERGE
- java - 在我的课堂上找不到 ( ) 的设置器/字段
- java - 如何使用 JavaFX CSS 删除带有嵌套标签的按钮的填充
- c# - 创建嵌套的自定义 WPF Activity 并执行嵌套的 Activity
- javascript - 提取模板中 Django 模型特征的最小值和最大值
- java - “-Dapp.pid=%%”在启动脚本中将不正确的 pid 传递给 java jvm 参数