smooth

Smoothing a 2-D figure

久未见 提交于 2019-12-04 09:36:00
问题 I have a number of vaguely rectangular 2D figures that need to be smoothed. A simplified example: fig, ax1 = plt.subplots(1,1, figsize=(3,3)) xs1 = [-0.25, -0.625, -0.125, -1.25, -1.125, -1.25, 0.875, 1.0, 1.0, 0.5, 1.0, 0.625, -0.25] ys1 = [1.25, 1.375, 1.5, 1.625, 1.75, 1.875, 1.875, 1.75, 1.625, 1.5, 1.375, 1.25, 1.25] ax1.plot(xs1, ys1) ax1.set_ylim(0.5,2.5) ax1.set_xlim(-2,2) ; I have tried scipy.interpolate.RectBivariateSpline but that apparently wants data at all the points (e.g. for a

HTML 5 video streaming .ism file?

余生长醉 提交于 2019-12-04 06:29:52
I have an IIS 7.0 server setup with Media Services 4.0. I created a very simple html 5 page which containts a video with its source pointing to a *.ism file. Is it possible to play the video using the manifest of the ism file in html 5, like in silverlight? Here's the html code: <html> <body> <video width="640" height="480" src="myvideo.ism/Manifest" autoplay="true" controls="true">vid</video> </body> </html> Ryan sorry, but that's not possible. there few supported formats: webm, ogv and mp4 but not all browsers support all of them. 来源: https://stackoverflow.com/questions/6470001/html-5-video

Smooth 2D surface

ε祈祈猫儿з 提交于 2019-12-04 01:55:53
I am wondering about the possibility to smooth the plot or make it somehow better, since now the pixels are too big. library(ggplot2) library(reshape2) # plot2d = melt(c) plot2d = melt(matrix(rnorm(20), 5)) # fake data names(plot2d) <- c("x", "y", "z") v <- ggplot(plot2d, aes(x, y, z = z)) v + geom_tile(aes(fill = z)) + scale_alpha_continuous(limits=c(start.point, end.point)) + scale_fill_gradient2('TYYYT',low="green", mid = "white", high="red") library(ggplot2) library(reshape2) set.seed(101) ## set dimnames so that melt() picks them up m <- matrix(rnorm(20),5,dimnames=list(x=1:5,y=1:4))

How to output smooth cspline curve as a data file

喜欢而已 提交于 2019-12-04 00:23:27
问题 Does anybody know how to extract some data of smooth cspline curve for a given data? For instance, there is a data file which has 2 columns corresponding to x and y values. I can draw the data with smooth cpline curve by the following commands p 'data' w lp, "" smooth csplines I want to extract the smooth cpline curve as an another data file. 回答1: This can be done by setting a table . Consider the following data file: 0 1 1 2 2 3 3 2 4 2 5 4 6 8 7 5 8 3 9 1 The data itself and its csplines

how do I select the smoothing parameter for smooth.spline()?

只谈情不闲聊 提交于 2019-12-03 13:45:30
I know that the smoothing parameter(lambda) is quite important for fitting a smoothing spline, but I did not see any post here regarding how to select a reasonable lambda (spar=?), I was told that spar normally ranges from 0 to 1. Could anyone share your experience when use smooth.spline()? Thanks. smooth.spline(x, y = NULL, w = NULL, df, spar = NULL, cv = FALSE, all.knots = FALSE, nknots = NULL, keep.data = TRUE, df.offset = 0, penalty = 1, control.spar = list(), tol = 1e-6 * IQR(x)) agstudy provides a visual way to choose spar . I remember what I learned from linear model class (but not

android drag view smooth

早过忘川 提交于 2019-12-03 11:24:43
I have to drag some views on screen. I am modifying their position by changing left and top of their layout parameters from motion event on ACTION_MOVE from touch listener. Is there a way to "drag" items more smooth? Because tis kind of "dragging" is no smooth at all... Here is the code public boolean onTouch(View view, MotionEvent motionEvent) { switch (motionEvent.getAction()) { case MotionEvent.ACTION_DOWN: dx = (int) motionEvent.getX(); dy = (int) motionEvent.getY(); break; case MotionEvent.ACTION_MOVE: int x = (int) motionEvent.getX(); int y = (int) motionEvent.getY(); RelativeLayout

How can I stretch bitmap in WPF without smoothing pixels

柔情痞子 提交于 2019-12-03 08:42:46
问题 I'm working on SEM image processing application, written in WPF. I have an image display control, derived from Canvas, which displays image & overlays using DrawingVisuals (one for each "layer"). It also implements Zoom & Pan using scale & translate transform, applied on DrawingVisuals. When I zoom in the image to see individual pixels, they are displayed smooth, evidently using bilinear filtering to stretch the bitmap (no surprise, as WPF is rendered through Direct3D). However, for my use

How to reproduce smoothScatter's outlier plotting in ggplot?

萝らか妹 提交于 2019-12-03 07:28:08
问题 I am trying to get something like what the smoothScatter function does, only in ggplot. I have figured out everything except for plotting the N most sparse points. Can anyone help me with this? library(grDevices) library(ggplot2) # Make two new devices dev.new() dev1 <- dev.cur() dev.new() dev2 <- dev.cur() # Make some data that needs to be plotted on log scales mydata <- data.frame(x=exp(rnorm(10000)), y=exp(rnorm(10000))) # Plot the smoothScatter version dev.set(dev1) with(mydata,

Mediaplayer progress update to seekbar not smooth?

有些话、适合烂在心里 提交于 2019-12-03 05:06:17
问题 I am working on an app with recorder and player. I am using mediaplayer to play the recorded .wav file and meantime I want to update to a seekbar. Everything is working fine But my problem is mediaplayer progress updation to seekbar is not happening smoothly, If we are playig a small file, thumb of the seekbar jumps in seconds or between. Can anyone help me with a workaround to make it smooth seeking of the progress in seekbar. My code is shown below.I am totlay stuck here. mediaPlayerIntiate

Smoothing a 2-D figure

﹥>﹥吖頭↗ 提交于 2019-12-03 03:31:41
I have a number of vaguely rectangular 2D figures that need to be smoothed. A simplified example: fig, ax1 = plt.subplots(1,1, figsize=(3,3)) xs1 = [-0.25, -0.625, -0.125, -1.25, -1.125, -1.25, 0.875, 1.0, 1.0, 0.5, 1.0, 0.625, -0.25] ys1 = [1.25, 1.375, 1.5, 1.625, 1.75, 1.875, 1.875, 1.75, 1.625, 1.5, 1.375, 1.25, 1.25] ax1.plot(xs1, ys1) ax1.set_ylim(0.5,2.5) ax1.set_xlim(-2,2) ; I have tried scipy.interpolate.RectBivariateSpline but that apparently wants data at all the points (e.g. for a heat map), and scipy.interpolate.interp1d but that, reasonably enough, wants to generate a 1d smoothed