- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经使用 timeseries.jl 成功创建,版本 1.5.3 (2020-11-09),在 Juno 中,使用 JuliaPro 安装,代码如下
尝试 1:
using IterableTables
using DataFrames
using CSV
using Dates
using TimeSeries
using Plots
myfile="test2.csv"
dmft = dateformat"d/m/yyyy HH:MM:SS"
df = DataFrame(CSV.File(joinpath(@__DIR__,myfile); dateformat=dmft))
println(first(df,10))
ta = TimeArray(df; timestamp = :Date)
println(colnames(ta))
display(plot(ta[:Col3]))
并获得了这个图
timeseries plot in Juno在我的 REPL 中有以下输出
10×5 DataFrame
│ Row │ Date │ Col1 │ Col2 │ Col3 │ Col4 │
│ │ DateTime │ Float64 │ Float64 │ Float64 │ Float64 │
├─────┼─────────────────────┼─────────┼─────────┼─────────┼─────────┤
│ 1 │ 2020-08-10T00:00:00 │ 507.28 │ 181.34 │ 1532.96 │ 183.16 │
│ 2 │ 2020-08-10T00:01:00 │ 507.29 │ 181.34 │ 1532.95 │ 183.16 │
│ 3 │ 2020-08-10T00:02:00 │ 507.27 │ 181.34 │ 1532.94 │ 183.16 │
│ 4 │ 2020-08-10T00:03:00 │ 507.28 │ 181.34 │ 1532.97 │ 183.16 │
│ 5 │ 2020-08-10T00:04:00 │ 507.29 │ 181.33 │ 1532.97 │ 183.16 │
│ 6 │ 2020-08-10T00:05:00 │ 507.29 │ 181.33 │ 1532.96 │ 183.16 │
│ 7 │ 2020-08-10T00:06:00 │ 507.27 │ 181.33 │ 1532.95 │ 183.16 │
│ 8 │ 2020-08-10T00:07:00 │ 507.28 │ 181.33 │ 1532.96 │ 183.16 │
│ 9 │ 2020-08-10T00:08:00 │ 507.27 │ 181.33 │ 1532.95 │ 183.16 │
│ 10 │ 2020-08-10T00:09:00 │ 507.28 │ 181.32 │ 1532.96 │ 183.16 │
[:Col1, :Col2, :Col3, :Col4]
不幸的是,它以图像的形式出现,如果我缩放分辨率不高,如下所示。
我希望实现的目标:
理想情况下,我更喜欢如下图所示的高分辨率图像,我可以使用 Shift 键和鼠标左键适本地放大它。
上图的数据框如下所示。
julia> print(first(mydf2,10))
10×8 DataFrame
│ Row │ ticker │ timestamp │ Open │ High │ Low │ Close │ AdjClose │ Volume │
│ │ String │ Date │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │ Float64 │
├─────┼────────┼────────────┼─────────┼─────────┼─────────┼─────────┼──────────┼───────────┤
│ 1 │ MSFT │ 2010-12-27 │ 28.12 │ 28.2 │ 27.88 │ 28.07 │ 22.3176 │ 2.16528e7 │
│ 2 │ MSFT │ 2010-12-28 │ 27.97 │ 28.17 │ 27.96 │ 28.01 │ 22.2699 │ 2.30422e7 │
│ 3 │ MSFT │ 2010-12-29 │ 27.94 │ 28.12 │ 27.88 │ 27.97 │ 22.2381 │ 1.95025e7 │
│ 4 │ MSFT │ 2010-12-30 │ 27.92 │ 28.0 │ 27.78 │ 27.85 │ 22.1427 │ 2.07861e7 │
│ 5 │ MSFT │ 2010-12-31 │ 27.8 │ 27.92 │ 27.63 │ 27.91 │ 22.1904 │ 2.4752e7 │
│ 6 │ MSFT │ 2011-01-03 │ 28.05 │ 28.18 │ 27.92 │ 27.98 │ 22.2461 │ 5.34438e7 │
│ 7 │ MSFT │ 2011-01-04 │ 27.94 │ 28.17 │ 27.85 │ 28.09 │ 22.3335 │ 5.44056e7 │
│ 8 │ MSFT │ 2011-01-05 │ 27.9 │ 28.01 │ 27.77 │ 28.0 │ 22.262 │ 5.89987e7 │
│ 9 │ MSFT │ 2011-01-06 │ 28.04 │ 28.85 │ 27.86 │ 28.82 │ 22.9139 │ 8.80263e7 │
│ 10 │ MSFT │ 2011-01-07 │ 28.64 │ 28.74 │ 28.25 │ 28.6 │ 22.739 │ 7.3762e7 │
使用来自 MarketData.jl 的数据和以下代码绘制:
using Gadfly
display(plot(mydf2,x="timestamp",y="AdjClose", Geom.line))
尝试 2:
我尝试用我的第一个数据系列来获得类似的结果,只是忽略了 TimeArray(因为它在尝试 1 中没有帮助),并得到了以下错误
myfile="test2.csv"
df = DataFrame(CSV.File(joinpath(@__DIR__,myfile)))
println(first(df,10))
display(plot(df,x="Date",y="Col3", Geom.line))
我收到以下数据框和错误消息:
10×5 DataFrame
│ Row │ Date │ Col1 │ Col2 │ Col3 │ Col4 │
│ │ DateTime │ Float64 │ Float64 │ Float64 │ Float64 │
├─────┼─────────────────────┼─────────┼─────────┼─────────┼─────────┤
│ 1 │ 2020-08-10T00:00:00 │ 507.28 │ 181.34 │ 1532.96 │ 183.16 │
│ 2 │ 2020-08-10T00:01:00 │ 507.29 │ 181.34 │ 1532.95 │ 183.16 │
│ 3 │ 2020-08-10T00:02:00 │ 507.27 │ 181.34 │ 1532.94 │ 183.16 │
│ 4 │ 2020-08-10T00:03:00 │ 507.28 │ 181.34 │ 1532.97 │ 183.16 │
│ 5 │ 2020-08-10T00:04:00 │ 507.29 │ 181.33 │ 1532.97 │ 183.16 │
│ 6 │ 2020-08-10T00:05:00 │ 507.29 │ 181.33 │ 1532.96 │ 183.16 │
│ 7 │ 2020-08-10T00:06:00 │ 507.27 │ 181.33 │ 1532.95 │ 183.16 │
│ 8 │ 2020-08-10T00:07:00 │ 507.28 │ 181.33 │ 1532.96 │ 183.16 │
│ 9 │ 2020-08-10T00:08:00 │ 507.27 │ 181.33 │ 1532.95 │ 183.16 │
│ 10 │ 2020-08-10T00:09:00 │ 507.28 │ 181.32 │ 1532.96 │ 183.16 │
ERROR: LoadError: Cannot convert DataFrame to series data for plotting
尝试 3:
因为它是 DateTime 格式,我想知道为什么这是一个问题。好的,所以我现在尝试了一些不同的东西,在加载数据时不更改格式,并且仍然不使用 TimeArray:
myfile="test2.csv"
# dmft = dateformat"d/m/yyyy HH:MM:SS"
df = DataFrame(CSV.File(joinpath(@__DIR__,myfile))) # dateformat=dmft removed
println(first(df,10))
display(plot(df,x="Date",y="Col3", Geom.line))
但我还是得到了这个结果:
10×5 DataFrame
│ Row │ Date │ Col1 │ Col2 │ Col3 │ Col4 │
│ │ String │ Float64 │ Float64 │ Float64 │ Float64 │
├─────┼────────────────┼─────────┼─────────┼─────────┼─────────┤
│ 1 │ 10/8/2020 0:00 │ 507.28 │ 181.34 │ 1532.96 │ 183.16 │
│ 2 │ 10/8/2020 0:01 │ 507.29 │ 181.34 │ 1532.95 │ 183.16 │
│ 3 │ 10/8/2020 0:02 │ 507.27 │ 181.34 │ 1532.94 │ 183.16 │
│ 4 │ 10/8/2020 0:03 │ 507.28 │ 181.34 │ 1532.97 │ 183.16 │
│ 5 │ 10/8/2020 0:04 │ 507.29 │ 181.33 │ 1532.97 │ 183.16 │
│ 6 │ 10/8/2020 0:05 │ 507.29 │ 181.33 │ 1532.96 │ 183.16 │
│ 7 │ 10/8/2020 0:06 │ 507.27 │ 181.33 │ 1532.95 │ 183.16 │
│ 8 │ 10/8/2020 0:07 │ 507.28 │ 181.33 │ 1532.96 │ 183.16 │
│ 9 │ 10/8/2020 0:08 │ 507.27 │ 181.33 │ 1532.95 │ 183.16 │
│ 10 │ 10/8/2020 0:09 │ 507.28 │ 181.32 │ 1532.96 │ 183.16 │
ERROR: LoadError: Cannot convert DataFrame to series data for plotting
我怀疑问题出在日期或日期时间上,但我无法确定。有一篇关于绘制时间序列数据的帖子,但使用 String 代替。 Gadfly.jl : How to plot date time based?导致我在下面尝试:
尝试 4:
myfile="test2.csv"
dmft = dateformat"d/m/yyyy HH:MM:SS"
df = DataFrame(CSV.File(joinpath(@__DIR__,myfile); dateformat=dmft)) # historical data for the ticker
dt = Array(df.Date)
dt_str = Array(String,length(dt))
for i=1:length(dt)
dt_str[i] = string(dt[i]);
end
错误信息如下:
ERROR: LoadError: MethodError: no method matching Array(::Type{String}, ::Int64)
这是我的 csv 的一小段,如果您想尝试一下。
Date,Col1,Col2,Col3,Col4
10/8/2020 0:00,507.28,181.34,1532.96,183.16
10/8/2020 0:01,507.29,181.34,1532.95,183.16
10/8/2020 0:02,507.27,181.34,1532.94,183.16
10/8/2020 0:03,507.28,181.34,1532.97,183.16
10/8/2020 0:04,507.29,181.33,1532.97,183.16
10/8/2020 0:05,507.29,181.33,1532.96,183.16
10/8/2020 0:06,507.27,181.33,1532.95,183.16
10/8/2020 0:07,507.28,181.33,1532.96,183.16
10/8/2020 0:08,507.27,181.33,1532.95,183.16
10/8/2020 0:09,507.28,181.32,1532.96,183.16
10/8/2020 0:10,507.29,181.32,1532.97,183.16
10/8/2020 0:11,507.28,181.33,1532.94,183.16
10/8/2020 0:12,507.27,181.33,1532.96,183.16
10/8/2020 0:13,507.31,181.33,1532.96,183.17
我是 Julia 的新手,非常感谢任何初学者级别的指南。
编辑:这里的问题是情节被渲染为图像。我做了 svg,这就是我得到的。不是很吸引人吧?所有高分辨率数据都聚集在一起。
一旦它被渲染为图像,这就是 TimeSeries.jl 所做的,而不是使用 plotly 或 gladfly(或其他后端引擎)进行绘图,那么我就失去了放大绘图的能力。
只要是高分辨率,不渲染成图片,不管是plotly还是gladfly还是其他的我都可以。
是的,花盆很长。如果那没有帮助,请忽略我的代码。在帖子的最后,如果有人不介意向我展示应该如何正确完成,我提供了一个简短的 csv。又来了。
Date,Col1,Col2,Col3,Col4
10/8/2020 0:00,507.28,181.34,1532.96,183.16
10/8/2020 0:01,507.29,181.34,1532.95,183.16
10/8/2020 0:02,507.27,181.34,1532.94,183.16
10/8/2020 0:03,507.28,181.34,1532.97,183.16
10/8/2020 0:04,507.29,181.33,1532.97,183.16
10/8/2020 0:05,507.29,181.33,1532.96,183.16
10/8/2020 0:06,507.27,181.33,1532.95,183.16
10/8/2020 0:07,507.28,181.33,1532.96,183.16
10/8/2020 0:08,507.27,181.33,1532.95,183.16
10/8/2020 0:09,507.28,181.32,1532.96,183.16
10/8/2020 0:10,507.29,181.32,1532.97,183.16
10/8/2020 0:11,507.28,181.33,1532.94,183.16
10/8/2020 0:12,507.27,181.33,1532.96,183.16
10/8/2020 0:13,507.31,181.33,1532.96,183.17
最佳答案
这个好像有用
显然,如果它在 String 中,它仍然有效。不知道为什么我昨天没有尝试这个
myfile="test2.csv"
dmft = dateformat"d/m/yyyy HH:MM:SS"
df = DataFrame(CSV.File(joinpath(@__DIR__,myfile)))
println(first(df,10))
using Gadfly
display(plot(df2, x="Date", y="Col3", Guide.xticks(label=false), Geom.line, Theme(grid_line_width=0mm)))
我试过 plotly,效果更好。我在一篇文章中说 DateTime 必须在字符串中,这让我陷入了困境。那不是真的。
using IterableTables
using DataFrames
using CSV
using Dates
using Plots
myfile="test2.csv"
dmft = dateformat"d/m/yyyy HH:MM:SS"
df = DataFrame(CSV.File(joinpath(@__DIR__,myfile); dateformat=dmft))
println(first(df,10))
df2 = filter(row -> row[:Date] <= Dates.DateTime("2020-10-15T00:06:00"), df)
plotly()
using StatsPlots
@df df plot(:Date, :Col3)
关于datetime - 如何在 Julia 中创建高分辨率时间序列图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65432468/
我正在使用 JavaFX 开发视频播放器。我正在将视频从本地文件系统加载到 JavaFX 类媒体中。然后我想获取宽度和高度,以便我可以将场景的尺寸设置为该大小: Media media = new M
我是OpenCV的新手,正在尝试解决这个问题。我有一个.mp4文件保存在从网络摄像头流式传输的磁盘上。现在,我需要制作视频的低分辨率版本,以上传到Web服务器(这个想法是,低分辨率预览实时或多或少地上
我在我的应用程序中使用 jfree 图表(折线图)...创建时我的图表看起来很模糊...我怎样才能获得高清晰度图像。 我使用过:ChartUtilities.writeScaledChartAsPNG
我正在用 Java 编写一个工具来处理我网站上上传的文件。我想以特定的方式管理图像:如果尺寸大于限制,我想首先调整图像的尺寸,然后再次检查尺寸。当然,我不想做无用的工作,所以我想在调整图像大小之前估计
是否有一种纯 WPF 方法来获取有关所有可用显示器大小(分辨率)的信息。我知道我可以使用 Screen.AllScreens 来获取它们,但在我的遗留项目中我无法添加新的引用(内置 WPF 程序集除外
看了Developer文档,部分理解了LDPI,HDPI,MDPI,XHDPI类比,网上到处找也没有找到具体答案。 我有两部手机,一部是小屏幕,一部是平板电脑。我希望我的小屏幕手机上的按钮看起来很小,
对于下面给定的网页, xyz {% load staticfiles %} html, body {
我在 Mac 上使用多个 JFrames 制作了一个程序,分辨率还可以,一切都适合屏幕。但是,当我在我的 PC 上运行该程序时,JFrames 太大并且会立即离开屏幕。 我的问题是:是否可以在 JFr
我需要有关如何检索屏幕分辨率的帮助,如下图所示。 我找到了 this documentation这真的很有帮助。这是我根据这些文档尝试的代码: int numberOfScreens = GetSys
有什么方法可以更改分辨率或为亚马逊 Kindle 键盘上的屏幕设置不同的边界?我的屏幕有一部分出现裂纹,我想解决这个问题。 我试过在文件系统中乱搞(通过 WiFi 连接),但我的所有属性更改都没有任何
快速提问, 我正在开发 libgdx 中的游戏,但遇到了问题。我正在尝试扩展我的 Assets ,我正在使用 Gdx.graphics.getDensity() 来获取密度,然后使用它作为乘数来设置我
我有一些关于屏幕分辨率的问题,我不清楚。这些问题假设我的应用程序将在 iOS 4.0 及更高版本以及 iPhone 3GS 或 iPhone 4 上运行。 启动图像 (default.png) 的大小
我们有一个应用程序在审核过程中被 Apple 应用程序审核人员拒绝。拒绝的原因是应用程序在 Ipad 上运行时无法正确缩放。 该应用程序本来就不是要在 Ipad 上运行的,但与他们争论这一点似乎没有意
我试图在不解码文件的情况下获取 JPEG 图像的分辨率。我从互联网上获得了几个样本,但没有一个可以正常工作。似乎是这样,因为许多 JPEG 文件不是标准的,尽管任何图形应用程序(Irfan、PSP、F
我尝试了很多事情,但是所有尝试都失败了。 我需要将灰度图像(2560x1440)调整为更低或更高的分辨率,然后我需要将边界设置为原始大小(2560x1440),但将调整后的图像保持在中心。 我使用的是
我正在使用 GLSulfaceView 开发一个静音相机应用程序,该应用程序从预览中捕获图片。 为了捕捉图片,我使用 GLES20.glReadPixels(0, 0, surfaceWidth, s
是否有相当于 yarn resolutions 的 npm功能? npm package.json docs 中没有提及它. 例如,我想在 3.3.2 上安装 lerna@3.3.2 及其依赖项之一
我制作了一个在 Arduino 上运行的 24x15 LED 显示屏,去年我在内存中放入了 32KB 的图形例程,这很酷。 但现在我已经升级到 Arduino Mega,具有 256KB 内存,并且有
我的场景是,我正在收集网络数据包,如果数据包与网络过滤器匹配,我想记录连续数据包之间的时间差,最后一部分是不起作用的部分。我的问题是,无论我使用什么 C 定时器函数,我都无法获得准确的亚秒级测量。我尝
我们一直在学校布置一项任务,需要更改图像(反转颜色、切换颜色、旋转 90 度、双倍大小、放大图像),现在我正在尝试通过将分辨率加倍来使其大小加倍,但无法弄清楚如何访问该地址并更改它。我们得到了两个函数
我是一名优秀的程序员,十分优秀!