- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图在 quantmod::chart_Series() 之上绘制一些支撑/阻力线。问题是有趣的支撑/阻力线超出(低于或高于)直到当前时间的系列数据范围(我还想将图表向右扩展到超出数据的最后一个时间戳)。
查看 quantmod::chart_Series() 的源代码,我看不到指定 ylim/xlim 的方法,或者在“过去”使用 quantmod::chartSeries 使用 yrange 覆盖 y 比例尺时可能发生的情况。在这里发表评论 https://r-forge.r-project.org/scm/viewvc.php?view=rev&root=quantmod&revision=520也证实了我的预感...
我的诊断是否正确,或者是否有一种方法可以在 quantmod::chart_Series 中启用 y 尺度覆盖?任何想法如何做我想要的高度赞赏。
谢谢。
最好的事物,
萨摩
最佳答案
chart_Series()
的帮助页面笔记——三遍! - 它是实验性的,所以大概最终的抛光版本将有很好的处理来设置这些限制。
在那之前,这里有一个 hack(?) 可以让你设置限制 和 可能会教你一些如何做 chart_Series()
工作(即通过创建类 "replot"
的环境/闭包,它存储创建图表所需的所有信息)。
## Create an example plot
getSymbols("YHOO")
myChob <- chart_Series(YHOO)
## Plot it, with its default xlim and ylim settings
myChob
## Get current xlim and ylim settings for `myChob` (chob = chart object)
myxlim <- myChob$get_xlim()
myylim <- myChob$get_ylim()
## Alter those limits
myxlim <- c(1, 2000)
myylim[[2]] <- structure(c(0, 50), fixed=TRUE)
## Use the setter functions in the myChob environment to set the new limits.
## (Try `myChob$set_ylim` and `ls(myChob$Env)` to see how/where these are set.)
myChob$set_ylim(myylim)
myChob$set_xlim(myxlim)
## Plot the revised graph
myChob
关于r - 在 quantmod::chart_Series() 中使用 xlim/ylim 或 xrange/yrange 覆盖 y-scale 和 x-scale - 不可能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11108206/
我正在绘制一个没有异常值的箱线图,我想在与箱线图相同的笛卡尔空间中创建一个新图。有没有办法提取绘图的绘图值? 我首先想到创建一个对象,但似乎没有与绘图相关的参数。 my_plot <- boxplot
我正在尝试绘制最大值 9.70 和最小值 -58.9 的数据。 我编码: plot(BriannaJan[,3,i], type = "line", col="black", main =
我正在尝试更改情节中的 ylim。但是一旦我改变它,情节就消失了。我无法弄清楚原因。有人可以帮我解决问题的根源吗? >dfp= 0.9 & df$Gain <= 1.25, ] Category
我想自定义绘图 y 轴上的间隙(中断)。我尝试了两种选择。 option1: ylim(0.0,0.6) option2: scale_y_continuous(breaks=seq(0.0, 0.6
我目前正在使用 ggplot2 制作多面箱图,我已经清除异常值并将 yLim 设置为 5000。 但是,并非所有箱线图(下图开头的箱线图)都接近 5000。我如何才能仅缩小图像中选定的少数箱线图的 y
我想在 r 的绘图中显示大数字。但我得到这个错误: 我的号码是: [1] "9,02E+11" "9,02E+11" "9,02E+11" "9,02E+11" "9,02E+11" "9,02E+1
我目前正在使用 ggplot2 制作多面箱图,我已经清除异常值并将 yLim 设置为 5000。 但是,并非所有箱线图(下图开头的箱线图)都接近 5000。我如何才能仅缩小图像中选定的少数箱线图的 y
我想在 r 的绘图中显示大数字。但我得到这个错误: 我的号码是: [1] "9,02E+11" "9,02E+11" "9,02E+11" "9,02E+11" "9,02E+11" "9,02E+1
我有这个简单的代码来绘制树状图,但功能 ylim似乎不起作用。所以无论我如何设置它,它在绘制时都有一个 [0,0.5] 的 y 范围。 绘制树状图时,我应该使用另一个参数来设置 ylim 吗? plo
当用 pandas 绘制数据框的列时,例如 df.boxplot() yaxis 的自动调整会导致绘图中出现大量未使用的空间。我想知道这是否是因为数据框的点超过了箱线图的须线(但由于某些原因未显示
当绘制下图时,NSS1 只是一个等于 1 的常数集,正好位于图的顶部边界,因此很难看到。 如何将 y 轴的长度更改为 1.2,以便可以更清楚地看到 NSS1? lambda=5; tau=0:30;
我有一系列要制作的箱形图,每个箱形图都有不同的范围。我尝试通过确定每个单独系列的最大值和最小值来设置 ylim。然而,在许多情况下,最小值是异常值,因此图被压缩了。我怎样才能选择情节的“ mustac
我有一个分组的 pandas 箱线图,排列在 (2,2) 网格中: import pandas as pd import numpy as np import matplotlib.pyplot as
matplotlib默认根据数据系列自动缩放坐标轴范围。pyplot模块中的autoscale函数可以切换是否自动缩放坐标轴范围,xlim()和ylim()函数可手动设置坐标轴范围。 autosc
首先我知道这个问题有人问过here和 here ,但这些都没有进一步帮助我。 我正在尝试设置图表的 ylim。关注的代码非常简单: plt.scatter(nDat, tDat) plt.ylim(2
我正在尝试绘制一个图,我可以在其中指定 y 轴的最小值或最大值。但我得到 Error in if (zero_range(range)) { : missing value where TRUE/FA
ggplot2 自动调整数据点的 ylim。有什么方法可以调整 stat_summary 的 ylim 吗? df <- structure(list(Varieties = structure(c(
有没有办法让 plot 函数自动生成相等的 xlim 和 ylim?我不想事先定义一个固定范围,但我希望 plot 函数来决定范围本身。但是,我希望它为 x 和 y 选择相同的范围。 最佳答案 一种可
举个例子,如果我想绘制一个包含点 1-5 的图并添加点 5-9,则可以使用以下方法: plot(c(1,2,3,4,5), ylim=c(0,10)) points(c(5,6,7,8,9)) 但是,
我有不止这些数据框列。我可以使用 ax=plt.gca() 设置底部图形,但是如何设置其他子图的限制? 下面是我用于绘图的代码。 SomeDataFrame.plot(subplots=True, s
我是一名优秀的程序员,十分优秀!