axis

Dual y axis (second axis) use in ggplot2

匿名 (未验证) 提交于 2019-12-03 02:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I come to encounter a problem that using two different data with the help of second axis function as described in this previous post how-to-use-facets-with-a-dual-y-axis-ggplot . I am trying to use geom_point and geom_bar but the since the geom_bar data range is different it is not seen on the graph. Here is what I have tried; point_data=data.frame(gr=seq(1,10),point_y=rnorm(10,0.25,0.1)) bar_data=data.frame(gr=seq(1,10),bar_y=rnorm(10,5,1)) library(ggplot2) sec_axis_plot <- ggplot(point_data, aes(y=point_y, x=gr,col="red")) + #Enc vs Wafer

d3.js yaxis not drawing all the ticks properly

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a datastructure like [{ name: "a", value: 5000}, { name: "b", value: 6000}, { name: "c", value: 7000}, { name: "d", value: 4000}] I try to draw a yaxis using the name and the value column using two different yaxis components. However, it appears that the value yaxis is missing one of the the last value (I get 4 ticks for the "name" yaxis labels and 3 ticks for the "value" yaxis labels). See the following fiddle: http://jsfiddle.net/namit101/AmHhg/73/ 回答1: It does not draw 3 ticks, as you say. Axis component uses interpolation. The

Inline labels in Matplotlib

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In Matplotlib, it's not too tough to make a legend ( example_legend() , below), but I think it's better style to put labels right on the curves being plotted (as in example_inline() , below). This can be very fiddly, because I have to specify coordinates by hand, and, if I re-format the plot, I probably have to reposition the labels. Is there a way to automatically generate labels on curves in Matplotlib? Bonus points for being able to orient the text at an angle corresponding to the angle of the curve. import numpy as np import matplotlib

find and delete from more-dimensional numpy array

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have two numpy-arrays: p_a_colors=np.array([[0,0,0], [0,2,0], [119,103,82], [122,122,122], [122,122,122], [3,2,4]]) p_rem = np.array([[119,103,82], [122,122,122]]) I want to delete all the columns from p_a_colors that are in p_rem, so I get: p_r_colors=np.array([[0,0,0], [0,2,0], [3,2,4]]) I think, something should work like p_r_colors= np.delete(p_a_colors, np.where(np.all(p_a_colors==p_rem, axis=0)),0) but I just don't get the axis or [:] right. I know, that p_r_colors=copy.deepcopy(p_a_colors) for i in range(len(p_rem)): p_r_colors= np

Return Inverse Hessian Matrix at the end of DNN Training and Partial Derivatives wrt the Inputs

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using Keras and Tensorflow as the backend, I have built a DNN that takes stellar spectra as an input (7213 data points) and output three stellar parameters (Temperature, gravity, and metallicity). The network trains well and predicts well on my test sets, but in order for the results to be scientifically useful, I need to be able to estimate my errors. The first step in doing this is to obtain the inverse Hessian matrix, which doesn't seem to be possible using just Keras. Therefore I am attempting to create a workaround with scipy, using

Dataframe Apply method to return multiple elements (series)

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: import pandas as pd Let's say I have a dataframe like so: df = pd.DataFrame({"a":range(4),"b":range(1,5)}) it looks like this: a b 0 0 1 1 1 2 2 2 3 3 3 4 and a function that multiplies X by Y: def XtimesY(x,y): return x*y If I want to add a new pandas series to df I can do: df["c"] =df.apply( lambda x:XtimesY(x["a"],2), axis =1) It works ! Now I want to add multiple series: I have this function: def divideAndMultiply(x,y): return x/y, x*y something like this ?: df["e"], df["f"] = df.apply( lambda x: divideAndMultiply(x["a"],2) , axis =1) It

Highcharts y-axis Ceiling not being respected

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem with Highcharts where the Ceiling of one of my two y-axes is not being respected. Y-axis "1" represents percentage values, so has a Floor of 0 and a Ceiling of 100. Y-axis "2" represents monetary values, so has a Floor of 0 and a Ceiling of null . For some reason, the labels for y-axis "1" go up to 150. If I change the corresponding series data so that the value 0 is changed to 20, the problem seems to go away and the labels stop at 100 as they should. var dataX = [0, 67, 43, 100, 100, 80]; var dataY = [950, 900, 807, 650,

creating a custom label for axis y in ASP.Net chart as a string

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a 3 point axis for axisY in a chart for ASP.NET. Right now it shows 1, 2, and 3. I need to assign string values to the points. I have found that it is somewhere in here: Chart1 . ChartAreas [ 0 ]. AxisY . CustomLabels . Add (??????); Not sure how to get it not to have to take a double value and be able to assign a string to the point. 回答1: You have to create a custom label, set its properties, then add it to the axis What about this? CustomLabel label = new CustomLabel (); label . FromPosition = - 1.0 ; label . ToPosition =

How to rotate image and axes together on Matlab?

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Code 1 where flipping vertically and/or horizontally does not affect axes() ; Code 2 where proposed solution does not yield the expected output close all; clear all; clc; x = [5 8]; y = [3 6]; C = [0 2 4 6; 8 10 12 14; 16 18 20 22]; C2 = C(:,end:-1:1,:); %# horizontal flip C3 = C(end:-1:1,:,:); %# vertical flip C4 = C(end:-1:1,end:-1:1,:); %# horizontal+vertical flip % https://stackoverflow.com/a/4010203/54964 subplot(2,2,1), imagesc(x,y,C) subplot(2,2,2), imagesc(x,y,C2) subplot(2,2,3), imagesc(x,y,C3) subplot(2,2,4), imagesc(x,y,C4) %%

Rotate image over X, Y and Z axis in Matlab [closed]

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to rotate an image over 3 axis in matlab. I used the function rotx, roty, rotz to create the rotation matrix but I don't know how to use. Are these methods considering the center point as origin? 回答1: Because an image is a 2D projection from a 3D world, one of the 3D planes needs to be set to 0 if you want this to work. I'm going to assume that the z -plane is equal to 0, and so the image is laying flat on the z = 0 plane. Basically... something like this, using the cameraman.tif image. This is what it originally looks like: Here