axis

Python, Matplotlib, subplot: How to set the axis range?

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I set the y axis range of the second subplot to e.g. [0,1000] ? The FFT plot of my data (a column in a text file) results in a (inf.?) spike so that the actual data is not visible. pylab.ylim([0,1000]) has no effect, unfortunately. This is the whole script: # based on http://www.swharden.com/blog/2009-01-21-signal-filtering-with-python/ import numpy, scipy, pylab, random xs = [] rawsignal = [] with open("test.dat", 'r') as f: for line in f: if line[0] != '#' and len(line) > 0: xs.append( int( line.split()[0] ) ) rawsignal.append( int

Transform only one axis to log10 scale with ggplot2

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have the following problem: I would like to visualize a discrete and a continuous variable on a boxplot in which the latter has a few extreme high values. This makes the boxplot meaningless (the points and even the "body" of the chart is too small), that is why I would like to show this on a log10 scale. I am aware that I could leave out the extreme values from the visualization, but I am not intended to. Let's see a simple example with diamonds data: m The problem is not serious here, but I hope you could imagine why I would

Autocorrelation of a multidimensional array in numpy

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a two dimensional array, i.e. an array of sequences which are also arrays. For each sequence I would like to calculate the autocorrelation, so that for a (5,4) array, I would get 5 results, or an array of dimension (5,7). I know I could just loop over the first dimension, but that's slow and my last resort. Is there another way? Thanks! EDIT: Based on the chosen answer plus the comment from mtrw, I have the following function: def xcorr(x): """FFT based autocorrelation function, which is faster than numpy.correlate""" # x is supposed

Axis2 - always getting 404 errors

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to move some Web Service stubs from Metro to Axis2, however after generating my stubs using wsdl2java I'm constently getting 404 errors whenever I try and make a service call. 16/12/2010 11:14:57 AM org.apache.axis2.deployment.ModuleDeployer deploy INFO: Deploying module: addressing-1.5.3-jar - file:/C:/Users/xxx/.m2/repository/org/apache/axis2/axis2/1.5.3/axis2-1.5.3-jar.jar 16/12/2010 11:14:57 AM org.apache.axis2.transport.http.HTTPSender sendViaPost INFO: Unable to sendViaPost to url[xxxx] org.apache.axis2.AxisFault: Transport

matplotlib: Aligning y-axis labels in stacked scatter plots

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In the plot bellow i have two scatter plots which have different number scale, so their Y-axis labels are not aligned. Is there any way I can force the horizontal alignment in the y-axis labels? import matplotlib.pylab as plt import random import matplotlib.gridspec as gridspec random.seed(20) data1 = [random.random() for i in range(10)] data2 = [random.random()*1000 for i in range(10)] gs = gridspec.GridSpec(2,1) fig = plt.figure() ax = fig.add_subplot(gs[0]) ax.plot(data1) ax.set_ylabel(r'Label One', size =16) ax = fig.add_subplot(gs[1])

Flip images at 30 degrees?

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In canvas I know that I can flip images horizontally and vertically by doing this: vc.scale(-1, -1) But is there some way to flip an image along a 30 degree symmetry line? 回答1: Yes, you can accomplish this using the rotate() method of canvas : var ctx = document.getElementById("myCanvas").getContext("2d"); var img = new Image(); img.src = "http://photos.the-scientist.com/articleImages/48000/48607-1-t.jpg"; img.onload = function() { ctx.rotate(30 * Math.PI / 180); ctx.translate(ctx.canvas.width / 2, ctx.canvas.height / 2); ctx.scale(1, -1);

Matplotlib pyplot set axis limits after rescaling equal

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have something like the following dataframe where each record is a point along a line. Fields include distance from the line's beginning and point elevation. >>> import pandas as pd >>> import matplotlib.pyplot as plt >>> >>> df=pd.DataFrame() >>> df['Distance']=[5,100,200,300,350,370,400] >>> df['Elevation']=[0,5,10,5,10,15,20] >>> df Distance Elevation 0 5 0 1 100 5 2 200 10 3 300 5 4 350 10 5 370 15 6 400 20 >>> I want to create a plot that shows the elevation profile. Both distance and elevation are scaled in feet and I want it so

primafaces chart x axis [duplicate]

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: Primefaces 5 Rotated Axis Tick Labels 1 answer You can see the problem from this site . Here is the code of my index.html file: <h:head></h:head> <h:form> <p:outputLabel value="Primefaces Tutorial"></p:outputLabel> <p:chart type="bar" model="#{viewEmployeesManagedBean.barModel}" style="height:500px" xaxisAngle="90" /> </h:form> </html> I create a chart in primefaces java. xAxis overlaps. I use xaxisAngle . But it seems it makes no difference. Any idea how to fix it? I want vertical xAxis labels. What

How to use sec_axis() for discrete data in ggplot2 R?

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have discreet data that looks like this: height <- c(1,2,3,4,5,6,7,8) weight <- c(100,200,300,400,500,600,700,800) person <- c("Jack","Jim","Jill","Tess","Jack","Jim","Jill","Tess") set <- c(1,1,1,1,2,2,2,2) dat <- data.frame(set,person,height,weight) I'm trying to plot a graph with same x-axis(person), and 2 different y-axis (weight and height). All the examples, I find is trying to plot the secondary axis (sec_axis) , or discreet data using base plots. Is there an easy way to use sec_axis for discreet data on ggplot2? Edit: Someone in

plotly.js axis &#039;anchor&#039; attribute

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to customize some subplots, but I don't understand what the axis 'anchor' attribute means. Some examples where this attribute is used are here: https://plot.ly/javascript/subplots/ . What does yaxis2: {anchor: 'x2'} mean? What does anchor=false , or anchor=free mean? I haven't been able to find an explanation in the online docs. 回答1: To answer my own question, I found the documentation on the axis anchor attribute here . An x axis can be anchored to a y axis, for example xaxis2: {anchor: 'y2'} means that xaxis2 joins yaxis2 at the