axis

matplotlib: adding second axes() with transparent background?

匿名 (未验证) 提交于 2019-12-03 01:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Define data x = np.linspace(0,2*np.pi,100) y = 2*np.sin(x) Plot fig = plt.figure() ax = plt.axes() fig.add_subplot(ax) ax.plot(x,y) Add second axis newax = plt.axes(axisbg='none') Gives me ValueError: Unknown element o , even though it does the same thing as what I am about to describe. I can also see that this works (no error) to do the same thing: newax = plt.axes() fig.add_subplot(newax) newax.set_axis_bgcolor('none') However, it turns the background color of the original figure "gray" (or whatever the figure background is)? I don't

Problem generating Java SOAP web services client with JDK tool wsimport from a WSDL generated by a .NET 2.0 application

a 夏天 提交于 2019-12-03 01:52:50
问题 I'm trying to generate a client for some SOAP web services using the JDK 6 tool wsimport . The WSDL was generated by a .NET 2.0 application. For .NET 3.X applications, it works fine. When I run wsimport -keep -p mypackage http://myservice?wsdl it shows several error messages like this: [ERROR] A class/interface with the same name "mypackage.SomeClass" is already in use. Use a class customization to resolve this conflict. line ?? of http://myservice?wsdl When I generate the web services client

Understanding tensordot

匿名 (未验证) 提交于 2019-12-03 01:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: After I learned how to use einsum , I am now trying to understand how np.tensordot works. However, I am a little bit lost especially regarding the various possibilities for the parameter axes . To understand it, as I have never practiced tensor calculus, I use the following example: A = np.random.randint(2, size=(2, 3, 5)) B = np.random.randint(2, size=(3, 2, 4)) In this case, what are the different possible np.tensordot and how would you compute it manually? 回答1: The idea with tensordot is pretty simple - We input the arrays and the

Orient object's rotation to a spline point tangent in THREE.JS

匿名 (未验证) 提交于 2019-12-03 01:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using SplineCurve3 to plot a line only on the X and Y axis, I have a cube successfully animating along this line by using spline.getPoint(t) where t is 0-1 in time. I am trying to orient the cube to the line via its up vector which is Y using the dot product. It is almost aligned but ever so slightly out. I thought that I would use the dot product of the Y vector and the tangent of the current point as the angle to rotate a quaternion to. Here is my render function: function render() { var updateMatrix = new THREE.Matrix4();

python/matplotlib - parasite twin axis scaling

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Trying to plot a spectrum, ie, velocity versus intensity, with lower x axis = velocity, on the upper twin axis = frequency The relationship between them (doppler formula) is f = ( 1 - v / c )* f_0 where f is the resulting frequency, v the velocity, c the speed of light, and f_0 the frequency at v=0, ie. the v_lsr. I have tried to solve it by looking at http://matplotlib.sourceforge.net/examples/axes_grid/parasite_simple2.html , where it is solved by pm_to_kms = 1. / 206265. * 2300 * 3.085e18 / 3.15e7 / 1.e5 aux_trans = matplotlib .

How to select max and min value in a row for selected columns

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Let us say we have the following table and I want to find max and min value for every row for a set of specific columns (let's say CENSUS2010POP, ESTIMATESBASE1010, POPESTIMATE2010). How to do it with Pandas? 回答1: I think you need min and max : df_subset=df.set_index('CTYNAME')[['CENSUS2010POP', 'ESTIMATESBASE1010', 'POPESTIMATE2010']] df1 = df_subset.min(axis=1) print (df1) df2= df_subset.max(axis=1) print (df2) EDIT: df = pd.DataFrame({'CTYNAME':['Alabama','Autauga County','Baldwin County','Barbour County'], 'CENSUS2010POP':[4,5,6,2],

Saving plots to pdf files using matplotlib

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to save more than 1 plot to a pdf file. Here is my code: import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages def function_plot(X,Y): plt.figure() plt.clf() pp = PdfPages('test.pdf') graph = plt.title('y vs x') plt.xlabel('x axis', fontsize = 13) plt.ylabel('y axis', fontsize = 13) pp.savefig(graph) function_plot(x1,y1) function_plot(x2,y2) I know that my ideas are scrambled but I can't find the way to write my code. The thing is that I need my graphs to have labeled x and y axis. 回答1: I was able to

Hide Axis in Bokeh

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How can I hide both x and y axis in a bokeh plot ? I've checked and tried based on this : p1= figure (... visible=None) p1.select({"type": "Axis", "visible": 0}) xaxis = Axis(plot=p1, visible = 0) and alike http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#axes But can get it done. Thanks 回答1: Create a figure object. So, in your example the figure object is p1 , then p1.axis.visible = False If you want to specify a y or x axis, then use p1.xaxis.visible = False or p1.yaxis.visible = False 回答2: Set the axes parameters

Python: Suplots with two secondary-axis

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is a follow up to this question . I thank maxnoe for the help. I would like to add a second secondary axis to each of my subplots similarly like in this example but in a subplot. I tried to set up my figure using: fig, ((ax1a, ax2a), (ax3a, ax4a)) = host_subplot(4,4, axes_class=AA.Axes) but I get TypeError: 'AxesHostAxesSubplot' object is not iterable and ValueError: Illegal argument(s) to subplot: (4, 4) Is it possible to have a subplot where each figure has two secondary axes? 回答1: plt.subplots is a convenience function for creating