axis

How can I change the font size of ticks of axes object in matplotlib [duplicate]

拟墨画扇 提交于 2019-12-03 10:50:23
问题 This question already has answers here : Matplotlib make tick labels font size smaller (10 answers) Closed 2 years ago . I have a figure I added subfigure to (inset). I have used: fig = plt.figure() ax = fig.add_subplot(111) subA = fig.add_axes([0.4,0.14,0.2,0.2]) I now want to change the xtick font size of the subfigure. I tried some naive approach such as subA.get_xaxis().get_xticks().set_fontsize(10) without any luck. How can I do this then? 回答1: Use: subA.tick_params(labelsize=6) 回答2: fig

Use superscripts in R axis labels

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using base graphics in R, how can I add superscripts to axis labels, as one might want to when plotting latitude and longitude axes on a map. Consider this example: plot(-100:-50, 50:100, type="n", xlab="", ylab="", axes=FALSE) axis(1, seq(-100, -50, 10), labels=paste(abs(seq(-100, -50, 10)), "o", "W", sep="")) axis(2, seq(50, 100, 10), labels=paste(seq(50,100,10), "o", "N", sep="")) box() Produces a nice frame around a map. It would be even nicer to make the degree symbol superscript. This can usually be done in other plotting functions

Making a standard normal distribution in R

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am using the following code to create a standard normal distribution in R: x I need the x axis to be labeled at the mean and at points three standard deviations above and below the mean. How can I add these labels? 回答1: The easiest (but not general) way is to restrict the limits of the x axis. The +/- 1:3 sigma will be labeled as such, and the mean will be labeled as 0 - indicating 0 deviations from the mean. plot ( x , y , type = "l" , lwd = 2 , xlim = c (- 3.5 , 3.5 )) Another option is to use more specific labels: plot ( x , y

Rescale axis on Seaborn JointGrid KDE marginal plots

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to create a seaborn JointGrid object with scatter+contours in the joint_plot and KDEs in the marginals. This gets me pretty close, but the y-axis marginal doesn't scale appropriately. What's the best way to manually rescale the marginal axes? Thanks in advance! f = p.figure() ax = f.add_subplot(111) g = sns.JointGrid(xdata, ydata, xlim=(0,1), ylim=(0,1)) g.plot_joint(sns.kdeplot, shade=True, cmap="Greys", n_levels=10) g.plot_joint(p.scatter, color='#e74c3c', s=1.5) g.plot_marginals(sns.kdeplot, color="black", shade=True) g.ax

How do I lazily concatenate “numpy ndarray”-like objects for sequential reading?

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a list of several large hdf5 files, each with a 4D dataset. I would like to obtain a concatenation of them on the first axis, as in, an array-like object that would be used as if all datasets were concatenated. My final intent is to sequentially read chunks of the data along the same axis (e.g. [0:100,:,:,:] , [100:200,:,:,:] , ...), multiple times. Datasets in h5py share a significant part of the numpy array API, which allows me to call numpy.concatenate to get the job done: files = [ h5 . File ( name , 'r' ) for name in

Java client calling WSE 2.0 with DIME attachment

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to integrate with a legacy .NET Web Service that uses WSE 2.0 for WS-Security and DIME. The catch is I need to do this from a Java application. I'm expecting that Axis2 works fine with the WS-Security because folks around here have done it before. It's the DIME that I'm concerned about. I see a reference to DIME at http://ws.apache.org/axis/java/client-side-axis.html , but I'm wondering if anyone has actually done this with Axis and a WSE 2.0 Web Service. 回答1: I can't tell you anything for sure from own expierence. And about every 2nd

OpenGL + SDL rotation around local axis

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been working on a semi flight simulator. What I am trying to do is use a pitch roll and yaw to rotate an object. I have already looked online a lot, and although they explain what the problem is I have no idea how to implement the solution. So for example I do: glRotatef(yaw,0,1,0); glRotatef(pitch,1,0,0); The yaw doesn't act properly, the pitch will work fine. And from what I have been reading it seems that the objects local axis has been changed so I need to find the object's new local axis and rotate around that. So I tried that with

Obtaining the camera rotation in radians on the X, Y, and Z axis in OpenGL?

匿名 (未验证) 提交于 2019-12-03 10:10:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to obtain the camera rotation on various axis in OpenGL (but using Java, LWJGL, and jME specifically). The camera object allows me to get the direction as a Vector3f, but this doesn't seem to work to get the componentised rotation; each axis appears tied to another axis. I found that toAngleAxis with the angle component with offset was a quick hack, but doesn't work properly in most situations. I'm not so good at maths unfortunately, otherwise I may have been able to work out this problem :) Again, I just need the X, Y

Arduino Code not executing after Wire.endTransmission line

匿名 (未验证) 提交于 2019-12-03 09:58:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on a project, syncing Nintendo Nunchuk with Arduino. I found a code online for the same from http://letsmakerobots.com/node/5684 Here, is the code #include <Wire.h>; void setup(){ Serial.begin(19200); nunchuck_setpowerpins(); nunchuck_init(); Serial.print("Nunchuck ready\n"); } void loop(){ nunchuck_get_data(); nunchuck_print_data(); delay(1000); } //=====================================================================================================================================================================================

amCharts: Always show 0 on value axis and enable negative velues to be displayed

匿名 (未验证) 提交于 2019-12-03 09:52:54
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have got this silly problem. I am creating a simple serial chart, displaying columns for two simple data series. The values are quite clse to eachother so amCharts decides to hide the 0 value axis and dislay only the relevant data. This is all good, but the thing is that I need to be able compare my columns visually. I also want to hide the labels on the value axis at some point. Generally what I get now is this: As you can see, value axis starts counting from 22.5. I need it to always start counting from 0, so I can compare the columns