axis

Python Pandas: Using 'apply' to apply 1 function to multiple columns

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Quick Pandas DataFrame question... Just a conceptual question Let's say I have a 3 column DataFrame. Call it df : A B C 0 1 2 3 1 1 2 3 2 1 2 3 3 1 2 3 4 1 2 3 Now let's say I have a function f(A,B,C) , which in theory would take columns A , B , and C as inputs. For example, def function(A,B,C): return (A+1, B/2, C*3) This function returns a tuple, of course. Essentially, I'd like to know if I could apply function to df to get the following output: A B C 0 2 1 9 1 2 1 9 2 2 1 9 3 2 1 9 4 2 1 9 If so, how would I do that? I can't just type df

d3.js - adding rectangles reading from json file in a svg

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am adding legends(through rectangles) on a svg. The data is read from different json files for each group of legend. I would like to draw the rectangles in the same svg. However only one set of legend is being added. Only the first json data is drawn as rectangles. The second is ignored. My code is : svgcheckins = d3 . select ( "#legend" ). append ( "svg" ). attr ( "id" , "svgcheckins" ) . attr ( "width" , 250 ) . attr ( "height" , 200 ) . append ( "g" ) . attr ( "transform" , "translate(" + margin . left + "," + margin . top + "

navbar Page and wrong update of ggvis plot Shiny

匿名 (未验证) 提交于 2019-12-03 01:44:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi I just create Shiny app. But there is a little problem when I want to present my Shiny app in navbarPage way. I mean, when I add new navbarPage named Introduction everithing works fine with plot till... I come back to Introduction navbarPage and then one again come back to Plot navbarPage , plot does not work well. What happended? How to fix it? ui.R library(dplyr) library(shiny) library(ggvis) shinyUI( navbarPage("", tabPanel("Introduction", fluidRow( column(3, wellPanel( ) ), column(9, br(),br(),br(), h5("This screen will soon display a

Adding years to X axis on line chart using jFreePanel

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have looked through other examples but not found one that answers this question. I'm using jFreePanel in java. I'm trying to create a line chart with the X-axis labeled marking the year change (ie: 2005, 2006, 2007, etc). The data is made up of readings taken daily, so it would not be possible to indicate each one, but breaking them down by year seems very reasonable. I'm struggling to figure out how to do it, though. So, instead of... X-axis __________________________________________________________________________________ 2000-01-01 to

Plotly axis as exponential format

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is a follow up on this question: SO Q The answer in the above question uses JavaScript code that turns an axis ticks into exponential. It works for a single axis on a single plot. When running it in a subplot() structure, it only works on the first plot when I apply it to the final plot. The modification I am looking for are these: 1: How to make it work on subplots. I tried calling JavaScript in the build of each subplot, but all plots came out without exponential then. 2: make it work for both x an y axis (I tried, failed and cried a

How to add a second x-axis in matplotlib

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a very simple question. I need to have a second x-axis on my plot and I want that this axis has a certain number of tics that correspond to certain position of the first axis. Let's try with an example. Here I am plotting the dark matter mass as a function of the expansion factor, defined as 1/(1+z), that ranges from 0 to 1. semilogy(1/(1+z),mass_acc_massive,'-',label='DM') xlim(0,1) ylim(1e8,5e12) I would like to have another x-axis, on the top of my plot, showing the corresponding z for some values of the expansion factor. Is that

axis2 Fault: The input stream for an incoming message is null

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am new to java web service and apache axis2.Every time i run my client i get an error that the input stream for an incoming message is null. What could the the issues? I have attached my log log4j:WARN No appenders could be found for logger (org.apache.axis2.util.Loader). log4j:WARN Please initialize the log4j system properly. org.apache.axis2.AxisFault: The input stream for an incoming message is null. at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:92) at org.apache.axis2.transport.TransportUtils

R how to create custom x-axis with dates

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to plot some prices vs dates. There are about 10k lines of data. The dates are a range from ~ 7/1/2008 - 12/1/2011. I'd like to be able to create a custom x-axis with the following ticks on it for each year: 1) at 1/1 have the YYYY (ie 2011 ) 2) at 4/1 have the abbreviation of the month (ie Apr ) 3) at 7/1 have the abbreviation of the month (ie Jul ) 4) at 10/1 have the abbreviation of the month (ie Oct ) Here's a description of the data: > head(as.POSIXct(rs4p[,3])) [1] "2008-06-30 20:00:00 EDT" "2008-06-30 20:00:00 EDT" [3]

Issues with Z-axis rotation matrix in glsl shader

匿名 (未验证) 提交于 2019-12-03 01:32:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've recently began putting together an opengl es 1.1/2.0 2D pipeline from the ground up (iPhone only). This pipeline is intended to be used by engineers with no 3D math experience. Commented out are the X and Y axis rotation matrices that produce the exact results they should . The Z rotation matrix seems to do nothing. VERTEX SHADER //THESE WORK /* highp mat4 rotationMatrix = mat4(1.0, 0.0, 0.0, 0.0, 0.0, cos(angle), -sin(angle), 0.0, 0.0, sin(angle), cos(angle), 0.0, 0.0, 0.0, 0.0, 1.0); highp mat4 rotationMatrix = mat4(cos(angle), 0.0,

Orientation from Android Accelerometer

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I testing the accelerometer output on 2 different devices(Elocity A7 and Archos 7 Home tablet) but the sensor seems to be giving different results. I have it programmed to set to landscape mode but the x and y axis seem to be the oppisite between the 2 devices. The x axis returns 10 when held perpendicular to the ground and the Archos X axis returns 0. The Elocity tablet is android 2.2 and the Archos is 2.1. Can someone point me in the right direction as how to get orientation from the accelerometer in sync between these 2 devices?