Skip to main content

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.

Filter by
Sorted by
Tagged with
992 votes
36 answers
561k views

Auto Scale TextView Text to Fit within Bounds

I'm looking for an optimal way to resize wrapping text in a TextView so that it will fit within its getHeight and getWidth bounds. I'm not simply looking for a way to wrap the text- I want to make ...
Nathan Fig's user avatar
  • 15.1k
314 votes
4 answers
406k views

How do I interpret precision and scale of a number in a database?

I have the following column specified in a database: decimal(5,2) How does one interpret this? According to the properties on the column as viewed in SQL Server Management studio I can see that it ...
mezoid's user avatar
  • 28.5k
312 votes
18 answers
168k views

How to capture UIView to UIImage without loss of quality on retina display

My code works fine for normal devices but creates blurry images on retina devices. Does anybody know a solution for my issue? + (UIImage *) imageWithView:(UIView *)view { ...
Daniel's user avatar
  • 3,331
200 votes
21 answers
389k views

Fit image into ImageView, keep aspect ratio and then resize ImageView to image dimensions?

How to fit an image of random size to an ImageView? When: Initially ImageView dimensions are 250dp * 250dp The image's larger dimension should be scaled up/down to 250dp The image should keep its ...
jul's user avatar
  • 37.2k
180 votes
8 answers
302k views

Fit Image in ImageButton in Android

I have 6 ImageButton in my activity, I set images through my code in them ( not using xml). I want them to cover 75% of the button area. But where as some images cover less area, some are too big to ...
Rohit's user avatar
  • 7,091
168 votes
8 answers
134k views

Adjusting the Xcode iPhone simulator scale and size [duplicate]

Is there anyway to make the iOS simulator for iPhone 5 in Xcode, be the actual size of the iPhone 5. I'm getting a huge display and things seemed to be scaled.
cdub's user avatar
  • 25.4k
139 votes
10 answers
120k views

How to scale Docker containers in production

So I recently discovered this awesome tool, and it says Docker is an open-source project to easily create lightweight, portable, self-sufficient containers from any application. The same ...
James Lin's user avatar
  • 26k
136 votes
3 answers
84k views

What is the difference between 'log' and 'symlog'?

In matplotlib, I can set the axis scaling using either pyplot.xscale() or Axes.set_xscale(). Both functions accept three different scales: 'linear' | 'log' | 'symlog'. What is the difference between '...
Denilson Sá Maia's user avatar
117 votes
6 answers
161k views

BigDecimal, precision and scale

I'm using BigDecimal for my numbers in my application, for example, with JPA. I did a bit of researching about the terms 'precision' and 'scale' but I don't understand what are they exactly. Can ...
jpadilladev's user avatar
  • 1,866
105 votes
3 answers
109k views

ConstraintLayout aspect ratio

Consider the following layout file: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas....
darklord's user avatar
  • 5,127
103 votes
5 answers
139k views

Scale and mirror SVG object

How do I most easily first scale an object, say 2 * times it's current size and then flip it vertically and horizontally, or both? As of now, I can either set "scale(2,2)" for it to become 2 times as ...
Deukalion's user avatar
  • 2,626
102 votes
4 answers
96k views

Android image scale animation relative to center point

I have an ImageView and I do a simple scale animation to it. Very standard code. My scale_up.xml: <set xmlns:android="http://schemas.android.com/apk/res/android"> <scale android:...
Tomislav Markovski's user avatar
94 votes
2 answers
151k views

Scale the contents of a div by a percentage?

Building a CMS of sorts where the user can move around boxes to build a page layout (basic idea anyway). I'd like to pull the actual contents in from the database and build out the "page", but have ...
Dave's user avatar
  • 29k
91 votes
13 answers
72k views

White space around css3 scale

I have a small issue I want to fix, but can't find any good answer : When I use a scale on a div (which contains other divs), it leave white space around, from the "original" width and height of my ...
Pretty Good Pancake's user avatar
88 votes
16 answers
112k views

How can I shrink the drawable on a button?

how can I make the drawable on a button smaller? The icon is too big, actually higher than the button. This is the code I am using: <Button android:background="@drawable/red_button" ...
Reto's user avatar
  • 1,542
83 votes
4 answers
208k views

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 ...
Jen's user avatar
  • 1,171
81 votes
21 answers
102k views

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 ...
vcLwei's user avatar
  • 1,937
81 votes
3 answers
343k views

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 ...
Rechlay's user avatar
  • 1,507
80 votes
9 answers
119k views

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 ...
cottonBallPaws's user avatar
76 votes
6 answers
133k views

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 ...
Suresh Karia's user avatar
62 votes
4 answers
58k views

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 ...
andreas's user avatar
  • 7,934
61 votes
8 answers
94k views

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.) ...
phil's user avatar
  • 917
56 votes
2 answers
73k views

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 ...
Hookstark's user avatar
  • 1,149
51 votes
13 answers
115k views

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....
JustADude's user avatar
  • 2,699
48 votes
6 answers
85k views

Apply StandardScaler to parts of a data set [duplicate]

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], '...
mitsi's user avatar
  • 1,155
42 votes
1 answer
22k views

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). <div> before </div> <div id="content-to-scale"> <div>something ...
kanaka's user avatar
  • 72.3k
41 votes
8 answers
35k views

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 ...
lyschoening's user avatar
  • 18.5k
41 votes
4 answers
65k views

CSS scale from left top

I am trying to scale my entire page from the top left. This is what my original page looks like: However when I try to scale my page, this happens: This is my CSS: html { zoom: 1.4; /* Old IE ...
2339870's user avatar
  • 1,437
40 votes
6 answers
124k views

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 ...
Walrus's user avatar
  • 20.3k
37 votes
4 answers
31k views

Change the thousands separator in a ggplot

While making a bar plot with ggplot I run into troubles getting the preferred thousands separator. I would like thousands to be separated by a dot instead of a comma. Like this it gives no separator: ...
Forzaa's user avatar
  • 1,515
37 votes
1 answer
14k views

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 ...
javiazo's user avatar
  • 1,942
37 votes
2 answers
62k views

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 ...
Perlnika's user avatar
  • 4,936
37 votes
8 answers
47k views

CSS: make div width proportional to height

This is a little tricky to explain, but: I want a responsive-height div (height: 100%) that will scale the width proportional to the height (not vice versa). I know of this method utilising a padding-...
indextwo's user avatar
  • 5,835
35 votes
7 answers
44k views

How to turn off autoscaling in Kubernetes with the kubectl command?

If I set to autoscale a deployment using the kubectl autoscale command (http://kubernetes.io/docs/user-guide/kubectl/kubectl_autoscale/), how can I turn it off and go back to manual scaling?
Jon's user avatar
  • 1,304
31 votes
5 answers
22k views

CGAffineTransform scale and translation - jump before animation

I am struggling with an issue regarding CGAffineTransform scale and translation where when I set a transform in an animation block on a view that already has a transform the view jumps a bit before ...
matteok's user avatar
  • 2,169
31 votes
1 answer
82k views

Css3 transition on scale only

I am missing something obvious. But the transition on only one element isn't working here. Here's my code. #navigatore-servizi ul li a { color: #fff; text-decoration: none; text-shadow: ...
Francesco Frapporti's user avatar
30 votes
3 answers
41k views

Can I scale a View in Android?

Can I take a view that has been rendered by the Android framework and rescale it to some other size?
bjdodson's user avatar
  • 519
29 votes
5 answers
14k views

Reduce the size of the iPhone Simulator window? [duplicate]

Is it possible to resize the iPhone Simulator? I'm using screen capture software to record a demo of my iPhone application, and it would be handy to be able to resize the iPhone Simulator window. ...
James Sun's user avatar
  • 1,461
29 votes
3 answers
57k views

[sklearn][standardscaler] can I inverse the standardscaler for the model output?

I have some data structured as below, trying to predict t from the features. train_df t: time to predict f1: feature1 f2: feature2 f3:...... Can t be scaled with StandardScaler, so I instead ...
hyon's user avatar
  • 349
29 votes
5 answers
22k views

Center Crop an Android VideoView

I am looking for something like the CENTER_CROP in ImageView.ScaleType Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be ...
clocksmith's user avatar
  • 6,256
28 votes
2 answers
39k views

Using transform: scale results in blurry images

In our catalog view (online store) we use javascript to get different views of the products and scale the images down with CSS. 3 in a row / 4 or 5/ The default view is 4: -webkit-transform: scale(...
grindking's user avatar
  • 927
28 votes
1 answer
107k views

scale_fill_discrete and scale_fill_manual - legend options confusion

I have a problem with applying two different changes on my ggplot2 object. I have a barplot with 3 groups on it. I want to: set color for each group reorder the order of legend labels I have found ...
Marta Karas's user avatar
  • 5,095
27 votes
9 answers
88k views

Scale Image Using PHP and Maintaining Aspect Ratio

Basically I want to upload an image (which i've sorted) and scale it down to certain constraints such as max width and height but maintain the aspect ratio of the original image. I don't have Imagick ...
Steve_M's user avatar
  • 445
27 votes
3 answers
31k views

How to relative scale size of User Control?

How to relative scale size of User Control like image (in image editor). Example (100%): (source: stegnar.com) Scaled down UC (70%): (source: stegnar.com) Well I achieve this in picture ...
Peter Stegnar's user avatar
26 votes
6 answers
23k views

How to force re-render after a WebKit 3D transform in Safari

I'm using CSS 3D transformations to zoom a div, for example: -webkit-transform: scale3d(2,2,1); The scaling itself works fine in any WebKit browser. However, when using this on Safari (mobile or ...
FatCat123's user avatar
  • 261
25 votes
4 answers
117k views

CSS: How to scale an image from the center instead of top-left

So my problem is that I have an image and I set its CSS to have a max-width: 100% which scales it at lower resolutions ( as will be seen in the fiddle below ). What I want is for the transition to ...
Eolis's user avatar
  • 645
25 votes
3 answers
69k views

CSS scale several images to fit viewport keeping aspect ratio

I'm creating a gallery where I want to list all images from an album on one page : Big Picture style : Unlike Big Picture, I want the images to proportionally scale to fit to the width of the ...
MindOverflow's user avatar
25 votes
1 answer
40k views

CSS: Wrong position of "transform: scale();" container children

I have a container element with long content which is scaled: .container { transform: scale(0.9); } inside this container I have a child div which is used to be a popup. It's positioned absolute ...
Kosmetika's user avatar
  • 21.1k
24 votes
8 answers
25k views

Stretch Image to Fit

The src should stretch its width to match_parent, while keeping aspect ratio. When the image is larger than the parent, it scales down correctly. But when the image is smaller, it does not scale up. ...
Matt's user avatar
  • 5,501
24 votes
2 answers
45k views

How to insert scale bar in a map in matplotlib

Any ideas on how can I insert a scale bar in a map in matplotlib that shows the length scale? something like the one I have attached. Or maybe any ideas on measuring and showing distances ...
Behnam's user avatar
  • 511

1
2 3 4 5
92