问题标签 [xscale]

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.

0 投票
1 回答
556 浏览

matlab - 以对数设置 xscale 时,contourf 不起作用

我正在尝试使用 coutourf() 但使用 xscale 对数进行绘图:

但是当我设置 xscale 时,我失去了填充(变成了一种轮廓但没有颜色)。我尝试使用 GUI 进行绘图,但结果相同

更新:我想我缩小了问题的范围。这是因为我使用了从 0 开始的 x 值。 这是我的示例(下一个是完全相同的数据,但只是将 xcale 放入日志中)

您无法通过以下方式获得相同的结果

我认为这是由于我的数据中非常拖尾的分布以及与颜色条的线性分割。任何想法让 x 从 0 开始?有对数刻度颜色条吗?(我尝试用 eps 替换它,但仍然不是很好)。谢谢

PS:我不能在这里放另一个链接是我的数据:www.filedropper.com/dd_3

0 投票
1 回答
211 浏览

lua - 在transition.to中的corona sdk xScale

如何xScaletransition.to一段时间内使对象变大这是我的行代码

假设我希望这种情况发生 5 秒钟,然后返回默认大小xscale =1yscale = 1.

0 投票
1 回答
842 浏览

r - ggplot few X-scale bold, rest not bold

I have a ggplot with on the x-scale the numbers from 0 to 21. I want the numbers 0,4,6,9,12,16,18 and 21 in bold, the rest has to stay like it is normal (grey, not bold)

How do I do that?

0 投票
1 回答
1625 浏览

d3.js - dc.js 过滤后修改时间刻度x轴

单击按钮后,我正在按日期以编程方式过滤 dc.js 时间序列图表。我希望代表时间尺度的 x 轴在应用我的数据过滤器时发生变化。相反,xaxis 保持不变,尽管图表在日期的任何一侧都下降了。我的情况可以通过在另一个问题中创建的 jsfiddle 来证明(在 dc.js 中 添加过滤器/Crossfilter 不更新图表)我不清楚该问题是否得到回答,但建议的 jsfiddle 演示了我遇到的问题:http://jsfiddle.net/PYeFP/5/

您可以看到,当您单击过滤器按钮时,数据已被适当过滤,但 xAxis 包含相同范围的值。
我尝试重新创建 x 比例并将其分配给图表的“x”属性:getCompositeDemandLine().x(xScale); //xScale 包含新的最小、最大日期

但这没有任何效果。

有没有办法使图表的域在过滤时发生变化?如果没有,有没有办法删除图表以便重新创建?

0 投票
1 回答
84 浏览

d3.js - Scale not giving expected values in d3.js

I'm pretty out of solutions here I'm creating a multi graph, with graps added dynamically by user Which is why I had to give variable names to the scales using the window method All seemed to work awesome, looks good also, however I am not seeing the values I am supposed to on the graph My initial values come from ajax

for example the start_range and end_range are 130,0 second ones are 290-160 basically increasing from top to bottom with 130 (height of each graph) and the 30 px I put between them the domains are 1415,1500 for the first graph and -20,20 for the second

And now the problems - I am trying to put a threshold line at 1437 in the first and 0 in the second

On the graph it is positioned somewhere near 1457 in the first case and 10 in the second (where it should be 0)

I thought maybe I mixed up some margins but the difference from where it is and where i want it is 20 in the first case and 10 in the second so i cannot force something like -20

I tried making 0 all the margins, still gives me wrong positioned line How come it's there? I tried alert(window['scale_'+param_name](1437)) and it gives me 95

I read the way the scales are transformed, so I've done it too my initial interval 1415-1500, difference=85 my graph interval 0-130, difference 130

but 1437 / 0.65 = 2210,7 I feel totally lost

And the second question is -.if I create the line and the circles based on my data, how come they are in different positions in the graph? (the circles are on top) which is correct?

I've desperately searched and nothing emerged Please just give me a hint if possible

Here is a working fiddle https://jsfiddle.net/zk5j5fno/ Thank you

0 投票
3 回答
1249 浏览

ios - 条形图给出负值

我正在使用 Charts API 并实现图表。我是新手,没有适用于 Swift 3 的适当文档。

我尝试并实施了,但不知道如何消除 y 的负比例。如何仅从 0 开始我的图表,所以它不显示负 y 刻度?

下面是我的代码:

图片:

在此处输入图像描述

在此处输入图像描述

0 投票
0 回答
36 浏览

r - R:如何使用 ggplot2 在第一个和最后一个 x 刻度处扩展这个多边形?

我有这个情节代码:

我的数据框bind.fine(只有前 300 行)是:

......

情节(以前的代码)是:在此处输入图像描述

问题是:如何扩展(或减少 x 轴)灰色矩形的尺寸,对应于 x 轴长度?

我试过了: scale_x_continuous(limits=c(as.Date(bind.fine[1,1]),as.Date(bind.fine[1356,1]))) 但结果是:

预期的结果是这样的: 在此处输入图像描述

0 投票
0 回答
41 浏览

ios - 在动画开始时自动调整纹理大小

我有一个问题。对于我的对象的动画,我在 Player 类中使用此方法:

当我使用虚拟摇杆时,在函数 touchesBegan() 中调用此方法。我的精灵的方向取自函数 touchesMoved() 中的条件:

但是我有一个问题,当我开始移动时,我的精灵的大小发生了变化,他的宽度和高度都变大了。如果我将 SKAction.animate 中的 resize 更改为 false,则高度是正常的,但宽度会在动画的所有时间内更改为小且正常。使用以下参数创建对象“玩家”:

有谁知道问题是什么?

0 投票
0 回答
457 浏览

r - 使用 facet wrap 调整时间序列的比例

我有来自海湾内 27 个环境站的 15 分钟间隔水温数据。我已经计算并绘制了整个海湾的日平均温度。我使用 facet_wrap 按年份绘制它们:2015 年、2016 年和 2017 年。但是 2015 年和 2016 年 12 月之后都有异常点(见下文)。有没有办法只显示 1 月到 12 月的数据,并剔除那些 12 月的异常值?在此处输入图像描述.

我的数据

我的代码

0 投票
1 回答
652 浏览

javascript - D3 多折线图无法正确显示 X 轴值

我在我的应用程序中实现了一个 D3v3 多折线图。由于我对 D3 图表很陌生,所以我寻找了一些在线资源并想出了这个。最初,我必须在 X 轴上显示 Years 并且它工作正常。这个小提琴显示了它(https://jsfiddle.net/yasirunilan/tz57wc29/13/)。然后根据一个新要求,我需要在 X 轴上显示月份的数据分布,不同之处在于 X 轴并不总是从一月份开始。正如数据集中给出的那样,它可能从一年的 10 月到一年的 10 月到明年的 9 月开始。在这种情况下,我在图表中显示线和 X 轴值时遇到了问题。有人可以为这个问题提供方向吗?

小提琴:https ://jsfiddle.net/yasirunilan/v160sr4z/10/