axis

Why does scipy.stats.nanmean give different result from numpy.nansum?

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: >>> import numpy as np >>> from scipy import stats >>> a = np.r_[1., 2., np.nan, 4., 5.] >>> stats.nanmean(a) 2.9999999999999996 >>> np.nansum(a)/np.sum(~np.isnan(a)) 3.0 I'm aware of the limitation of floating point representation. Just curious why the more clumsy expression seems to give "better" result. 回答1: First of all, here is scipy.nanmean() so that we know what we're comparing to: def nanmean(x, axis=0): x, axis = _chk_asarray(x,axis) x = x.copy() Norig = x.shape[axis] factor = 1.0-np.sum(np.isnan(x),axis)*1.0/Norig x[np.isnan(x)] =

How to scale x axis and add ticks in R

匿名 (未验证) 提交于 2019-12-03 01:21:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I build an Histogram in R using geom_histogram, I want to scale my x axis up to 155 insted of 252 that is showing and to see a tick evrey 5 numbers (0,5,10 etc), I used the scale_x_continuous(breaks=(0,155,5) . it worked but the histogram is not presented all across the screen. I used xlim(0,155) it showed the histogram all across the screen but it override the ticks I defined. 回答1: The problem is that xlim(0, 155) is actually a shorthand for scale_x_continuous(lim = c(0, 155)) . Therefore, when you use both, xlim() and scale_x_continuous()

Matplotlib parasite logarithmic axis ticks unwanted mirrorring

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to make a plot with two y-axes, one of them logarithmic and one linear, using host_subplot from mpl_toolkits.axes_grid1. The figure looks ok, with the exception of the minor ticks from the secondary y-axis (right) being also displayed on the primary y-axis (left), on the inside of the figure. import matplotlib . pyplot as plt from mpl_toolkits . axes_grid1 import host_subplot import mpl_toolkits . axisartist as AA host = host_subplot ( 111 ) host . set_yticks ( np . arange (- 12 , - 3 , 1.0 )) par1 = host . twinx () par1

How to use Axis WSDL2Java generated files?

那年仲夏 提交于 2019-12-03 01:20:01
I generated Java files from WSDL with WSDL2Java converter, but I don't know how can I use service with these files, because there are no examples. I'm implementing client side. Regarding Axis2: read these these links they contain some examples: http://ws.apache.org/axis2/1_5_1/quickstartguide.html#clients http://ws.apache.org/axis2/1_0/userguide3.html EDIT: Regarding Axis1: it is based on JAX-RPC and you need to instantiate stub object or use service locator to get stub instance and all WS operations will be in that. An example is given here : public class Tester { public static void main

Qt Transform matrix

匿名 (未验证) 提交于 2019-12-03 01:18:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to manipulate QML items through QMatrix4x4, in order to apply some perspective transformations. Basically, I defined the class Transform to use an object QMatrix4x4 as argument for the transform field of the QML Item class Transform : public QQuickTransform{ Q_OBJECT Q_PROPERTY(QMatrix4x4 matrix READ matrix WRITE setMatrix NOTIFY matrixChanged) public: explicit Transform(QQuickItem *parent = 0); QMatrix4x4 matrix() const; void setMatrix(QMatrix4x4 matrix); virtual void applyTo(QMatrix4x4 *matrix) const; signals: void matrixChanged();

Android Low pass filter and High pass filter

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a very basic question. What is Low Pass filter and High Pass filter in case of Android Accelerometer? When I see the output from the Accelerometer Sensor, I see If I don't use any filter, (Case : I kept my cell phone idle on table) I get z Axis +ve value. Now If I think using basic physics, it gives me exact value(9.8approx) for small g i.e Acceleration due to gravity. To get the linear acceleration, If I add any force to phone it will change the Accelerometer value, but it will be g + a that I applied. So to get a why can't I just

All series on a given axis must be of the same data type

匿名 (未验证) 提交于 2019-12-03 01:13:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I early had problems with formatting the time, but now having problem with showing the google chart visualiszation out of this error: All series on a given axis must be of the same data type. This is the goal, with date and time: http://jsbin.com/yaqew/1/edit As I have been notified the google chart constructor will not accept the time/date string: https://developers.google.com/chart/interactive/docs/reference#dataparam Database: PHP:

Custom tick size on axis (d3js)

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am creating a svg x-y-chart in d3.js. Is it possible to create ticks of different lengths depending on tickValue? I have made my own tickFormat function myTickFormat and use that in .tickFormat([format]) and that works fine because [format] is expected to be a function. But it is not possible to do the same with .innerTickSize([size]) , which expects a number. E.g. if I want the tick at value 70 to be longer I want to do something like this: var myTickSize = function(d) { if (d === 70) { return 20;} return 6; }; But when I use myTickSize

JFreeChart - How to show real-time on the X-Axis of a TimeSeries chart

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to show live data on a TimeSeries chart with real time shown on the x-axis (or at least have the speed of the time the same as real-time). Here is a SSCCE of the problem with random numbers as the live input. The time shown on the x-axis is much faster than real-time (assuming it is shown in hh:mm:ss format): public class DynamicTimeSeriesChart extends JPanel { private DynamicTimeSeriesCollection dataset; private JFreeChart chart = null; public DynamicTimeSeriesChart(final String title) { dataset = new DynamicTimeSeriesCollection(1,

Add line break to axis labels and ticks in ggplot

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm looking for a way to use long variable names on the x axis of a plot. Of course I could use a smaller font or rotate them a little but I would like keep them vertical and readable. As an example: df here the x axis is just letters, but if I want to use the full name, the names use a disproportionate amount of space: plot + theme ( axis . text . x = element_text ( angle = 90 ))+ scale_x_discrete ( breaks = unique ( df_M$variable ), labels = c ( "Ambystoma mexicanum" , "Daubentonia madagascariensis" , "Psychrolutes marcidus" ))