问题标签 [plotrix]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
r - 带有分类 X 轴的条形图
我正在尝试生成一个带有分类 X 轴和两个不同 y 轴的条形图。我正在尝试使用 twoord.plot 生成条形图,如下所示:
但是,我收到错误“plot.window(...) 中的错误:'xlim' 值无效”。
有没有办法将分类/字符变量用作 x 轴?另外,有没有办法旋转 X 轴标签,使它们显示在 45 度?
我已经能够使此代码与以下更改一起使用:
但是,我仍然需要弄清楚如何旋转 X 轴标签以及添加图例来区分哪个是箱线图和哪个是线图。对此的任何帮助将不胜感激
谢谢你。
r - R 轴中断代码错误(plottrix gap.plot)
当我尝试打破绘图轴时,我总是会出错。我使用plotrix pkg。
到目前为止我的代码:
我收到此错误:
实际上我认为我并不需要 xlim 和 ylim。但是,如果我不使用它,我收到一个错误,提示我 xlim 丢失。
为什么我需要在 Y 轴上有一个间隙:我的数据在 x 和 y 轴上的范围都是 0 到 1。在 y 轴上,我得到了一个异常值。因此,我在 Y 轴上没有介于 0.4 和 0.6 之间的数据点。因此,我想把这一部分删掉。我的代码做错了什么?感谢您的帮助,对此感到抱歉-也许-初学者问题。
r - Creating a histogram with multiple data series using multhist in R
I want to create a histogram with multiple data series on the same plot. The best method that I can find to do this is multhist()
. I would like a plot in a style similar to hist()
, and while ggplot()
can also be used to perform this task, the graphics style is not what I want.
Here is some example data:
And here is the code that I have used so far:
This provides me with a 'barplot style' multi histogram, but I am having issues changing two graph parameters.
I would like the plot to look more like a histogram and less like a barplot, so firstly I want to remove (or reduce) the space between the columns. I have tried using
space = NULL
, but this command does not appear to work with multhistI would like to change the x-axis so that axis tick marks are present in between bars on the plot and axis text is aligned with tick marks rather than positioned at the bar midpoint. I have tried using
axis(side=1, …)
, but as multhist uses list objects to create plots these commands don’t appear to work.
Any suggestions would be greatly appreciated. Suggestions for other useful graphics packages that can plot histograms with multiple datasets would also be welcomed.
r - 试图使 twoord.plot 具有交互性
我有一个使用 thettwoord
函数创建的图。我正在尝试使它成为一个交互式图形,以便我可以用鼠标悬停在一个点周围并查看该图的 x,y 坐标。
我不知道如何使用该twoord.plot
功能执行此操作。知道怎么做吗?
r - 如何在 R 中的 twoord.plot 中旋转 Y 轴标签?
有谁知道如何在 R 中的函数 twoord.plot 中旋转 Y 轴标签?另外,如何调整 Y 轴标签的字体大小?
r - Change the circumferential radial grid segment lines color in the radial.plot function. Plotrix
I have two datasets which contain values
for a radial plot and colors
for the radial grid lines of this plot.
First dataset:
Second dataset:
When I make the radial plots with the following function, I get plots with either colored circular grid lines or non colored circular grid lines. Both plots have the correct radial grid lines colored red.
How do I get the radial grid lines the get colored and not the circular grid lines? Is grid.col
the wrong argument the use here?
correct image from dataset 1 (black circular grid + highlighted radial grid lines):
http://i.imgur.com/5e9mJys.png
incorrect image from dataset 2 (red circular grid + highlighted radial grid lines):
r - 增加绘图标签之间的空间
pie3D
我正在使用from plotrix
package绘制一个 3D 饼图:
我得到以下信息:
如您所见,标签彼此重叠。我尝试修改mar
输入(边距),但效果不佳。有没有办法增加图表上标签之间的间距,从而减少卡顿?请记住,我希望图形的半径保持固定在 0.9
谢谢!
r - 为什么轴承没有在图中的正确方位角对齐?
我在 R 中使用 plotrix 包。该polar.plot
功能允许我绘制每个轴承的目标频率。我有这个例子:
你能试试这个吗?我无法弄清楚为什么它们没有正确对齐。
r - 在 3d 绘图上绘制水平线(2 个圆周)
我正在尝试将尺寸为 xy 的两个圆周与 3d 绘图一起绘制并为两个圆的交点着色,我该怎么做?
r - 在 R 中断开 X 轴
我想在我的情节中得到一个损坏的 X 轴。在 x 轴上,我喜欢插入一个断轴符号< // >
[从 2 开始,到 8 结束,这意味着 2-8 将隐藏在< // >
符号中],以便可以强调其他值。在 Matlab 中,此任务是通过使用BreakXAxis执行的。在 R 中,plotrix库仅有助于插入断轴符号,仅此而已。