rescale

define color gradient for negative and positive values scale_fill_gradientn()

时光怂恿深爱的人放手 提交于 2019-12-10 07:27:49
问题 R version 3.1.1 (2014-07-10) Platform: i386-w64-mingw32/i386 (32-bit) I am working on a heatmap with ggplot2() values from -1 to +1. I want to achieve that negative values have a bluish gradiend from darkblue(-1) to lightblue(-0.00000001) and the positive values a redish one from lightred(0.00000001) to darkred(1). Small values should not fade into white, as zeros should have white color and there shall be a visible contrast between 0 and a small value. NA values should be grey. I tried scale

How to apply a set of functions to each group of a grouping variable in R data.frame

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 08:15:26
I need to reshape data.frame in R in one step . In short, change of values of objects (x1 to x6) is visible row by row (from 1990 to 1995): > tab1[1:10, ] # raw data see plot for tab1 id value year 1 x1 7 1990 2 x1 10 1991 3 x1 11 1992 4 x1 7 1993 5 x1 3 1994 6 x1 1 1995 7 x2 6 1990 8 x2 7 1991 9 x2 9 1992 10 x2 5 1993 I am able to do reshaping step by step, does anybody know how do it in one step? Original data Table 1 - see that minimal value from all timeseries is "0" Step1: Table 2 - rescale each timeseries that each would have minimal value equal "0". All times fall down on x-axes . Step2

define color gradient for negative and positive values scale_fill_gradientn()

和自甴很熟 提交于 2019-12-05 13:12:38
R version 3.1.1 (2014-07-10) Platform: i386-w64-mingw32/i386 (32-bit) I am working on a heatmap with ggplot2() values from -1 to +1. I want to achieve that negative values have a bluish gradiend from darkblue(-1) to lightblue(-0.00000001) and the positive values a redish one from lightred(0.00000001) to darkred(1). Small values should not fade into white, as zeros should have white color and there shall be a visible contrast between 0 and a small value. NA values should be grey. I tried scale_fill_gradient2() and scale_fill_gradientn() also with rescale() . A similar topic has been discussed,

Scale KineticJS Stage with Browser Resize?

此生再无相见时 提交于 2019-12-05 02:38:47
问题 Recently discovered KineticJS as I've been trying to convert my Flash skills to HTML Canvas. It is an extremely impressive tool! Question: If I'm using a front-end like Bootstrap and I have a page with several divs that contain KineticJS-generated canvases, can I get those canvases to scale along with everything else on the page? Thanks much. ----- Due to character limit of comments, I'm replying in the OP. --------- Would you set it up so that there is a maximum size and then have it scale

Zooming and loading very large TIFF file

依然范特西╮ 提交于 2019-12-04 13:33:55
问题 I have a very large hi-res map which I want to use in an application (imagesize is around 80 mb). I would like to know the following: How can I load this image the best way possible? I know it will take some seconds to load the image (which is ok) but I would like to notify the user of the progress. I would like to use a determined mode and show this in some sort of JProgressBar to the user. This should reflect the number of bytes that have been loaded or something like that. Is there any

Scale KineticJS Stage with Browser Resize?

我们两清 提交于 2019-12-03 17:35:43
Recently discovered KineticJS as I've been trying to convert my Flash skills to HTML Canvas. It is an extremely impressive tool! Question: If I'm using a front-end like Bootstrap and I have a page with several divs that contain KineticJS-generated canvases, can I get those canvases to scale along with everything else on the page? Thanks much. ----- Due to character limit of comments, I'm replying in the OP. --------- Would you set it up so that there is a maximum size and then have it scale as when the browser is scaled? For example, in Actionscript I did this to track the size of the browser

Obtaining unstandardized factor scores from factor analysis

会有一股神秘感。 提交于 2019-12-02 05:13:52
问题 I'm conducting a factor analysis of several variables in R using factanal(). I want to determine each case's factor score, but I want the factor scores to be unstandardized and on the original metric of the input variables. When I run the factor analysis and obtain the factor scores, they appear to be standardized and not on the original metric of the input variables. How can I obtain unstandardized factor scores that have the same metric as the input variables? Ideally, this would mean a

Java image resize, maintain aspect ratio

寵の児 提交于 2019-11-27 02:42:27
I have an image which I resize: if((width != null) || (height != null)) { try{ // scale image on disk BufferedImage originalImage = ImageIO.read(file); int type = originalImage.getType() == 0? BufferedImage.TYPE_INT_ARGB : originalImage.getType(); BufferedImage resizeImageJpg = resizeImage(originalImage, type, 200, 200); ImageIO.write(resizeImageJpg, "jpg", file); } catch(IOException e) { System.out.println(e.getMessage()); } } This is how I resize the image: private static BufferedImage resizeImage(BufferedImage originalImage, int type, Integer img_width, Integer img_height) { BufferedImage

Automatic rescaling of an application on high-dpi Windows platform?

房东的猫 提交于 2019-11-26 22:33:42
I'm writing a Qt application that needs to run on high-dpi Windows (192dpi instead of 96dpi). Unfortunately the Qt framework does not have support for high-dpi yet (at least on Windows), so my application and all its elements looks half the size it should. Is there any way to force/simulate automatic upscaling of such apps by Windows? Nejat Applications that use fixed coordinates and sizes will look small on high-DPI resolutions. Although even if using layouts there are some issues regarding element and font sizes and margins. Fortunately there is support for high-DPI displays since Qt 5.4 as

Java image resize, maintain aspect ratio

不羁岁月 提交于 2019-11-26 10:10:26
问题 I have an image which I resize: if((width != null) || (height != null)) { try{ // scale image on disk BufferedImage originalImage = ImageIO.read(file); int type = originalImage.getType() == 0? BufferedImage.TYPE_INT_ARGB : originalImage.getType(); BufferedImage resizeImageJpg = resizeImage(originalImage, type, 200, 200); ImageIO.write(resizeImageJpg, \"jpg\", file); } catch(IOException e) { System.out.println(e.getMessage()); } } This is how I resize the image: private static BufferedImage