axis

Perfectly align several plots

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My aim is a compounded plot which combines a scatterplot and 2 plots for density estimates. The problem I'm facing is that the density plots do not align correctly with the scatter plot due to the missing axes labeling of the density plots and the legend of the scatter plot. It could be adjusted by playing arround with plot.margin . However, this would not be a preferable solution since I would have to adjust it over and over again if changes to the plots are made. Is there a way to position all plots in a way so that the actual plotting

Interpolation on DataFrame in pandas

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a DataFrame, say a volatility surface with index as time and column as strike. How do I do two dimensional interpolation? I can reindex but how do i deal with NaN ? I know we can fillna(method='pad') but it is not even linear interpolation. Is there a way we can plug in our own method to do interpolation? 回答1: You can use DataFrame.interpolate to get a linear interpolation. In : df = pandas.DataFrame(numpy.random.randn(5,3), index=['a','c','d','e','g']) In : df Out: 0 1 2 a -1.987879 -2.028572 0.024493 c 2.092605 -1.429537 0.204811 d

stop ggplot2 from dropping data points outside of axis limits?

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: If I make a line plot (a time series, for example) and set my axis limits, I want the line to continue off the plot when points are outside of the axis limits, and then come back into the plot for the next point that is within the axis limits. Right now, it seems that ggplot2 will just drop the points completely and give me a an "Error:" message. 回答1: If you limit your axes by reducing the axis scale ( scale_x_continuous(limits=...) ), then that is the expected behavior. By adjusting the scale, you are defining what data should be

How to rotate a object on axis world three.js?

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Is it possible to do rotations taking axis of the world and not of the object? I need to do some rotations of an object, but after the first rotation, I can't do other rotations like i want. If it's not possible to do rotation on the axis of the world, my second option is to reset the axis after the first rotation. Is there some function for this? I can't use object.eulerOrder because it changes the orientation of my object when I set object.eulerOrder="YZX" after some rotations. 回答1: Yes you can do it with a function which was

Setting aspect ratio of 3D plot

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to plot a 3D image of the seafloor from the data of a sonar run over a 500m by 40m portion of the seafloor. I am using matplotlib/mplot3d with Axes3D and I want to be able to change the aspect ratio of the axes so that the x & y axis are to scale. An example script with generated data rather than the real data is: import matplotlib . pyplot as plt from matplotlib import cm from mpl_toolkits . mplot3d import Axes3D import numpy as np # Create figure. fig = plt . figure () ax = fig . gca ( projection = '3d' ) # Generate

Rotating x axis labels in R for barplot

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to get the x axis labels to be rotated 45 degrees on a barplot with no luck. This is the code I have below: barplot(((data1[,1] - average)/average) * 100, srt = 45, adj = 1, xpd = TRUE, names.arg = data1[,2], col = c("#3CA0D0"), main = "Best Lift Time to Vertical Drop Ratios of North American Resorts", ylab = "Normalized Difference", yaxt = 'n', cex.names = 0.65, cex.lab = 0.65) 回答1: EDITED ANSWER PER DAVID'S RESPONSE: Here's a kind of hackish way. I'm guessing there's an easier way. But you could suppress the bar labels and the

numpy all differing from builtin all

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the reason for this weirdness in numpy's all ? >>> import numpy as np >>> np.all(xrange(10)) False >>> np.all(i for i in xrange(10)) True 回答1: Numpy.all does not understands generator expressions. From the documentation numpy.all(a, axis=None, out=None) Test whether all array elements along a given axis evaluate to True. Parameters : a : array_like Input array or object that can be converted to an array. Ok, not very explicit, so lets look at the code def all(a,axis=None, out=None): try: all = a.all except AttributeError: return

multiple plot in one figure in Python

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am new to python and am trying to plot multiple lines in the same figure using matplotlib. Value of my Y axis is stored in a dictionary and I make corresponding values in X axis in my following code My code is like this: for i in range(len(ID)): AxisY= PlotPoints[ID[i]] if len(AxisY)> 5: AxisX= [len(AxisY)] for i in range(1,len(AxisY)): AxisX.append(AxisX[i-1]-1) plt.plot(AxisX,AxisY) plt.xlabel('Lead Time (in days)') plt.ylabel('Proportation of Events Scheduled') ax = plt.gca() ax.invert_xaxis() ax.yaxis.tick_right() ax.yaxis.set_label

How to align multiple ggplot2 plots and add shadows over all of them

匿名 (未验证) 提交于 2019-12-03 02:12:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Please download the data here! Target: Plot an image like this: Features: 1. two different time series; 2. the lower panel has a reverse y-axis; 3. shadows over two plots. Possible solutions: 1. Facetting is not appropriate - (1) can not just make one facet's y axis reverse while keep the other(s) unchanges. (2) difficult to adjust the individual facets one by one. 2. Using viewports to arrange individual plots using the following codes: library(ggplot2) library(grid) library(gridExtra) ##Import data df<- read.csv("D:\\R\\SF_Question.csv") #

Error in WCF client consuming Axis 2 web service with WS-Security UsernameToken PasswordDigest authentication scheme

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a WCF client connecting to a Java based Axis2 web service (outside my control). It is about to have WS-Security applied to it, and I need to fix the .NET client. However, I am struggling to provide the correct authentication. I am aware that WSE 3.0 might make it easier, but I would prefer not to revert to an obsolete technology. Similar issues (unsolved), include this , this and this . The SOAP message should look like this: <wsse:UsernameToken> <wsse:Username><!-- Removed--></wsse:Username> <wsse:Password Type="http://docs.oasis