Questions tagged [scale]

The scale tag is mostly used for questions that relate to proportional resizing of images or UI elements. It is also used for questions related to function scale() in R language.

In scientific software for statistical computing and graphics, the function scale performs standardization of a vector or a matrix (by column).

4504 questions
81
votes
21 answers

How do I scale a UIButton's imageView?

I created a UIButton instance named "button" with an image using [UIButton setImage:forState:]. The button.frame is larger than the image's size. Now I want to scale this button's image smaller. I tried changing button.imageView.frame,…
vcLwei
  • 1,927
  • 3
  • 16
  • 13
80
votes
9 answers

How to set the initial zoom/width for a webview

I am trying to get the WebView to have similar behavior as the android browser. The browser opens all pages in a way that tries to fit their width to the screen. However, the default behavior of the WebView is to start at a 100% pixel scale so it…
cottonBallPaws
  • 21,220
  • 37
  • 123
  • 171
80
votes
4 answers

Understanding `scale` in R

I'm trying to understand the definition of scale that R provides. I have data (mydata) that I want to make a heat map with, and there is a VERY strong positive skew. I've created a heatmap with a dendrogram for both scale(mydata) and log(my data),…
Jen
  • 1,141
  • 2
  • 11
  • 16
77
votes
3 answers

Plotting with ggplot2: "Error: Discrete value supplied to continuous scale" on categorical y-axis

The plotting code below gives Error: Discrete value supplied to continuous scale What's wrong with this code? It works fine until I try to change the scale so the error is there... I tried to figure out solutions from similar problem but…
Rechlay
  • 1,457
  • 2
  • 12
  • 19
72
votes
6 answers

Zoom Vs. Scale in CSS3

I was looking for some css properties that I never used and came to know about zoom property of css3 What is the similarities and difference between them? When to use Zoom and when scale? Both do pretty much the same job. Which is more efficient to…
Suresh Karia
  • 17,550
  • 18
  • 67
  • 85
62
votes
4 answers

Scale UIView and all its children

I have an UIView with around 50 UIButtons. All button positions were given in pixels, relative to the left upper corner of my main UIView. All (background) images used in the view are available in higher resolution. As I am porting my app from…
andreas
  • 7,844
  • 9
  • 51
  • 72
61
votes
8 answers

WebKit: Blurry text with css scale + translate3d

I'm seeing an issue where Chrome and other WebKit browsers massively blur any css-scaled content that also has translate3d applied. Here's a JS Fiddle: http://jsfiddle.net/5f6Wg/. (View in Chrome.) .test { -webkit-transform: translate3d(0px,…
phil
  • 897
  • 1
  • 8
  • 9
55
votes
2 answers

scikit-learn: how to scale back the 'y' predicted result

I'm trying to learn scikit-learn and Machine Learning by using the Boston Housing Data Set. # I splitted the initial dataset ('housing_X' and 'housing_y') from sklearn.cross_validation import train_test_split X_train, X_test, y_train, y_test =…
Hookstark
  • 1,097
  • 3
  • 11
  • 23
48
votes
13 answers

HTML Color Codes: Red to Yellow to Green

I would like to come up with as many HEX HTML values to have a smooth color gradient from red to green: I would like this to be similar to the following: http://www.utexas.edu/learn/html/colors.html I don't have the best eye for color choices, so…
JustADude
  • 2,619
  • 7
  • 31
  • 45
47
votes
6 answers

Apply StandardScaler to parts of a data set

I want to use sklearn's StandardScaler. Is it possible to apply it to some feature columns but not others? For instance, say my data is: data = pd.DataFrame({'Name' : [3, 4,6], 'Age' : [18, 92,98], 'Weight' : [68, 59,49]}) Age Name Weight 0 …
mitsi
  • 1,005
  • 2
  • 11
  • 15
42
votes
1 answer

Scale/zoom a DOM element and the space it occupies using CSS3 transform scale()

In the middle of my page I have a div element with some content in it (other divs, images, whatever).
before
something inside
another something
kanaka
  • 70,845
  • 23
  • 144
  • 140
40
votes
6 answers

CSS image scaling to fit within area not distort

Is there a way with CSS or otherwise of making an image fit within an area. Lets say I have multiple images of different sizes and I want them all to fit within a div of 150px by 100px. I don't want to scale the images though as some may be tall and…
Walrus
  • 19,801
  • 35
  • 121
  • 199
38
votes
8 answers

Matplotlib axis with two scales shared origin

I need two overlay two datasets with different Y-axis scales in Matplotlib. The data contains both positive and negative values. I want the two axes to share one origin, but Matplotlib does not align the two scales by default. import numpy as…
lyschoening
  • 18,170
  • 11
  • 44
  • 54
37
votes
2 answers

gnuplot: how to use a*(10^b) format on axis

I am using really big numbers (milions) on my x-axis, so when I use set format x %6.0f I got big numbers like 25000000. That is quite nice, but takes much space, so there are only few labels and reader losts information. When I exclude setting…
Perlnika
  • 4,796
  • 8
  • 36
  • 47
37
votes
1 answer

Get device image scale (e.g. @1x, @2x and @3x)

I have an app that uses a service to get some icons. With this service I can get any image of any size, so I've planned to get the 3 images (@1x, @2x and @3x) and store them on the BBDD, and then get the scale to use one of these three; or maybe…
javiazo
  • 1,892
  • 4
  • 26
  • 41