axis

Column chart with primary and secondary y-axes

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My problem seems simple, I just want to make a column chart with 2 y-axes. When I do this, Excel automatically puts the columns overlapping. I do not want them overlapped! How do I go about correcting this? An image of what is happening: 回答1: You could achieve the chart as shown below with some rather careful manipulation: Basically is requires spacing out your data as shown in columns A:C but also right-aligning the horizontal axis labels, adjusting the secondary axis maximum (and format of both vertical axes, if necessary) and the Gap

converting numbers on y axis to string with K for thousand d3.js

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: i am using d3.js charts to plot y axis and x axis .. its working fine ... but the values in y axis you can say range is say 0 to 10000 and i want if the number is greater than thousand it will come with K say if the number is 1000 it will show 1K, for 15000 it will show on y axis ticks 15K how to do that .. i am not able to manupulate y.domain and range functions for the string values ... var y = d3 . scale . linear (). range ([ height , 0 ]); y . domain ([ 0 , //d3.min(cities, function(c) { return d3.min(c.values, function(v) {

Remove mean from numpy matrix

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a numpy matrix A where the data is organised column-vector-vise i.e A[:,0] is the first data vector, A[:,1] is the second and so on. I wanted to know whether there was a more elegant way to zero out the mean from this data. I am currently doing it via a for loop: mean=A.mean(axis=1) for k in range(A.shape[1]): A[:,k]=A[:,k]-mean So does numpy provide a function to do this? Or can it be done more efficiently another way? 回答1: As is typical, you can do this a number of ways. Each of the approaches below works by adding a dimension to

exception: The AXIS engine could not find a target service to invoke! targetService is SecurityDepositServiceImpl

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am new to web-service and I have created one web service in my existing project using eclipse 'Bottom Up java Bean service', server is Tomcat 6, Spring Framework 2.5, and not using Maven and Ant. In my project eclipse automatically included all required jars in lib but when I try to invoke getName() from browser it gives error like: exception: The AXIS engine could not find a target service to invoke! targetService is SecurityDepositServiceImpl So please suggest me what should I do to run my service? 回答1: I have recieved this error in the

Different right and left axes in a MATLAB plot?

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I plot a single trace in MATLAB with plot() . I'd like to add a right-y axis with a different set of tick marks (scaled linearly). Is this possible? 回答1: There are a number of good suggestions on this closely related question , although they deal with a more complicated situation than yours. If you want a super-simple DIY solution, you can try this: plot ( rand ( 1 , 10 )); % Plot some random data ylabel ( gca , 'scale 1' ); % Add a label to the left y axis set ( gca , 'Box' , 'off' ); % Turn off the box surrounding the whole axes

Quaternion camera. How do I make it rotate correctly?

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a 3D camera with its current rotation stored as a quaternion, and I'm having trouble rotating it correctly. I want the camera to rotate incrementally around its local axes based on mouse movement each frame (first-person-shooter-style), but the rotation is wrong. It kind of works, but the camera seems to "roll" around its forward axis when it shouldn't. I update the rotation each frame with this function: void Camera::rotate(const Quat& q) { // m_rot is the current rotation m_rot = m_rot * q; } Here's my quaternion multiplication

Pandas: sum DataFrame rows for given columns

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the following DataFrame: import pandas as pd df = pd.DataFrame({'a': [1,2,3], 'b': [2,3,4], 'c':['dd','ee','ff'], 'd':[5,9,1]}) I would like to add a column 'e' which is the sum of column 'a', 'b' and 'd'. Going across forums, I thought something like this would work: df['e'] = df[['a','b','d']].map(sum) But no! I would like to realize the operation having the list of columns ['a','b','d'] and df as inputs. 回答1: You can just sum and set param axis=1 to sum the rows, this will ignore none numeric columns: In [91]: df = pd.DataFrame({'a

bounding box of numpy array

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Suppose you have a 2D numpy array with some random values and surrounding zeros. Example "tilted rectangle": import numpy as np from skimage import transform img1 = np.zeros((100,100)) img1[25:75,25:75] = 1. img2 = transform.rotate(img1, 45) Now I want to find the smallest bounding rectangle for all the nonzero data. For example: a = np.where(img2 != 0) bbox = img2[np.min(a[0]):np.max(a[0])+1, np.min(a[1]):np.max(a[1])+1] What would be the fastest way to achieve this result? I am sure there is a better way since the np.where function takes

Displaying minor logarithmic ticks in x-axis in R

匿名 (未验证) 提交于 2019-12-03 02:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a normal distribution plot and a histogram plot with x axis in log scale displaying 0, 10^0, 10^1 ... I want to include minor ticks between the major ones. Actually I was able to change the major ticks format from 1, 2, 3 and so on to 10^0, 10^1, 10^2, 10^3 using the solution given to me in my previous question . I used the following code for the major ticks : major.ticks <- axTicks(1) labels <- sapply(major.ticks,function(i) as.expression(bquote(10^ .(i))) ) axis(1,at=major.ticks,labels=labels) Can this be edited to just mark the

Customize x-axis in matplotlib

匿名 (未验证) 提交于 2019-12-03 02:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In the figure below, each unit in the x-axis represents a 10mins interval. I would like to customize the labels of x-axis, so that it shows hours, i.e. it displays a ticker every 6 units (60mins). I am new to matplotlib. Could someone help me? Thanks~ Here is the code for the above figure. x = arange(0, size_x, dx) y = arange(0, size_y, dy) X,Y = meshgrid(x, y) Z = foo(x,y) pcolor(X, Y, Z, cmap=cm.Reds) colorbar() axis([0,size_x-1,0,size_y-1]) show() 回答1: There's more than one way to do this. Let's start out with an example plot: import