scale

geom_raster faceted plot with ggplot2: control row height

こ雲淡風輕ζ 提交于 2019-12-06 11:16:09
In the example below I have a dataset containing two experiments F1 and F2. A classification is performed based on F1 signal, and both F1 and F2 values are ordered accordingly. In this diagram, each facet has the same dimension although the number of rows is not the same ( e.g class #7 contains only few elements compare to the other classes). I would like to modify the code to force row height to be the same across facets (facets would thus have various blank space below). Any hints would be greatly appreciated. Thank you library(ggplot2) library(reshape2) set.seed(123) # let's create a fake

How to do Joint tracking in Kinect with a scaled Image

做~自己de王妃 提交于 2019-12-06 09:56:59
问题 I trying to do some Joint Tracking with kinect (just put a ellipse inside my right hand) everything works fine for a default 640x480 Image, i based myself in this channel9 video. My code, updated to use the new CoordinateMapper classe is here ... CoordinateMapper cm = new CoordinateMapper(this.KinectSensorManager.KinectSensor); ColorImagePoint handColorPoint = cm.MapSkeletonPointToColorPoint(atualSkeleton.Joints[JointType.HandRight].Position, ColorImageFormat.RgbResolution640x480Fps30);

Javascript Image Resize Calculation

社会主义新天地 提交于 2019-12-06 09:39:44
Let's say I have an image that is 1920 x 1280. I'm using a slider to scale down the image, which goes from 100% to 0%, where 100% is the original size and 0% is the minimum size. The image can be no smaller than 350 in either height, or width, so 0% should equate to this minimum size. What formula would I use to calculate the new dimensions? If you could explain the logic, that would be helpful. I'm certain this is an SAT question that I failed... var min=Math.min(width,height); var result=Math.max(min * (percentage/100),350); var newHeight=(result/min) * height; var newWidth=(result/min) *

Problems having content in webbrowser scale automatically in Windows Form Application

别来无恙 提交于 2019-12-06 09:29:58
I'm trying to create a program which scrolls through files located on my computer and displays the files. This is working for me so far but I'm getting content in actual size so the webbrowser adds a scrollbar(obviously). I want the content to scale automatically so it fits in the webbrowser without having to scroll. Code: WebBrowser web = new WebBrowser(); System.Drawing.Rectangle workingRectangle = Screen.PrimaryScreen.WorkingArea; int heightWebcontrol = workingRectangle.Height / 100 * 85; int widthwebControl = workingRectangle.Width / 100 * 75; web.Size = new Size(widthwebControl,

Calculate the width and height of parent div and apply to image accordingly

怎甘沉沦 提交于 2019-12-06 09:13:05
I have a parent div which in responsive width and fixed height with some images inside it. On runtime I need a Jquery function to calculate the width and height of the div and apply the width (px) and height (px) parameters to image. i.e my code right now is <div id="slider-wrapper" class="someclass"> <img src="/image1.jpg" alt="" /> <img src="/image2.jpg" alt="" /> <img src="/image3.jpg" alt="" /> </div> the generated code which I need would be <div id="slider-wrapper" class="someclass"> <img src="/image1.jpg" height="300px" width="total-div-width(px)" alt="" /> <img src="/image2.jpg" height=

UIImageView Resizing / Scaling - SWIFT

烂漫一生 提交于 2019-12-06 05:46:05
I have a UIImageView that's size(width = screensize, height = 239). I now download an image that is size(width = 1366 and height = 445). I can't use Aspect Fit (because of white background) or Scale (screws up the aspect ratio). I do want to use Aspect Fill and align it in a specific way - i.e. aspect fill on right aligned or aspect fill on left aligned. Does anyone know how to do this? I've used different libraries like Toucan but I can't seem to get it to work. Thanks a bunch SO. You can use SDWebImage or Kingfisher to show placeholder image and for caching... Then in its completion block

How to use MediaQuery to set scaleFactor for text in Flutter?

↘锁芯ラ 提交于 2019-12-06 05:38:32
问题 With MediaQuery I can get height and width of my Samsung S7 Edge screen size so I can work with it. But how to use MediaQuery to layout the multiple column dynamic text in ListTile? In my demo project I set the text size to 12 and in Samsung S6 I get overflow issues... Any info or example for text scale factor in Flutter? I found one solution here (How can Flutter handle dpi text and image size differences) and I try to build demo project. S6 textScaleFactor is 1.1 an the S7 is 1.0.... My

div shifts after jquery scale effect

Deadly 提交于 2019-12-06 05:37:14
问题 I have a div that after scaling, shifts to the left and down and I can't see why this is happening. See http://jsfiddle.net/7A7gs/2 for all code. I've tried using animate width/height instead of scale, and the same thing happens. I've also tried size instead of scale. Same thing. Also, if I change the scale from 'both' to vertical, the div does not shift. If I change the scale to 'horizontal' the div shifts. Please let me know where I'm going wrong here! MTIA. EDIT: The desired behaviour is

R use list of values as color scale

大城市里の小女人 提交于 2019-12-06 03:55:36
问题 I'd like to represent the value of a variable as a color of a dot in a scatter in R. x <- rnorm(100) + 5 y <- rnorm(100) + 5 plot(x, y) Here, I'd like to use a variable as input for the coloring. But if I try plot(x, y, col = x) I get something weird, probably obviously. Now I can get what I want like this: x_norm = (x - min(x)) / (max(x) - min(x)) col_fun <- colorRamp(c("blue", "red")) rgb_cols <- col_fun(x_norm) cols <- rgb(rgb_cols, maxColorValue = 256) plot(x, y, col = cols) But that

QGraphicsView scrolling and image scaling/cropping

萝らか妹 提交于 2019-12-06 03:06:21
问题 I would like to have a background image in my QGraphicsView that is always scaled (and cropped if necessary) to the size of the viewport, without scrollbars and without scrolling with the keyboard and mouse. The example below is what I am doing to scale and crop an image in the viewport, but I am using random values for the cropping that are pulled out of the aether. I would like a logical solution? MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui-