Questions tagged [rescale]
155 questions
77
votes
11 answers
Resize image, maintain aspect ratio
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 ?…

Fofole
- 3,398
- 8
- 38
- 59
47
votes
2 answers
SKLearn MinMaxScaler - scale specific columns only
I'd like to scale some (but not all) of the columns in a Pandas dataFrame using a MinMaxScaler. How can I do it?

lte__
- 7,175
- 25
- 74
- 131
21
votes
5 answers
Automatic rescaling of an application on high-dpi Windows platform?
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…

Robin Lobel
- 630
- 1
- 5
- 16
10
votes
1 answer
define color gradient for negative and positive values scale_fill_gradientn()
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…

VDK
- 789
- 8
- 15
7
votes
4 answers
Correct way to standardize/scale/normalize multiple variables following power law distribution for use in linear combination
I'd like to combine a few metrics of nodes in a social network graph into a single value for rank ordering the nodes:
in_degree + betweenness_centrality = informal_power_index
The problem is that in_degree and betweenness_centrality are…

Jacob Rigby
- 1,323
- 2
- 15
- 20
6
votes
1 answer
skimage.transform.rescale changes datatype from uint8 to float64
When I use skimage.transform.rescale to reduce size of an image by 40% the datatype is converted from uint8 to float64.
I can manually change the datatype but I don't want to have too many manual interventions in my code.
Is there any rescaling…

Uğur Dinç
- 303
- 3
- 16
6
votes
2 answers
.net Drawing.Graphics.FromImage() returns blank black image
I'm trying to rescale uploaded jpeg in asp.net
So I go:
Image original = Image.FromStream(myPostedFile.InputStream);
int w=original.Width, h=original.Height;
using(Graphics g = Graphics.FromImage(original))
{
g.ScaleTransform(0.5f, 0.5f); ... //…

joox
- 243
- 5
- 13
5
votes
2 answers
How can I scale an array to another length saving it's approximate values in R
I have two arrays with different lengths
value <- c(1,1,1,4,4,4,1,1,1)
time <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)
How can I resize the value array to make it same length as the time array, saving it's approximate values ?
approx() function…

Alexander.Iljushkin
- 4,519
- 7
- 29
- 46
5
votes
1 answer
Zooming and loading very large TIFF file
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)…

Héctor van den Boorn
- 1,218
- 13
- 32
4
votes
3 answers
Error in UseMethod("rescale") : no applicable method for 'rescale' applied to an object of class "c('haven_labelled', 'vctrs_vctr', 'double')"
I am getting the following error:
Error in UseMethod("rescale") : no applicable method for 'rescale'
applied to an object of class "c('haven_labelled', 'vctrs_vctr',
'double')"
Here is my code for the plot:
ggplot(data_q_agg3, aes(x = 'qmrcms', y…

Luke Thompson
- 41
- 1
- 2
3
votes
3 answers
Rescaling Image in Windows Form
I have a set of points I want to show on a 2000x2000 canvas. Here is an example: "61.86, 83 - 61.79, 82.91 - 61.77, 82.77 - 61.92, 82.76 - 61.75, 82.7 - 61.79, 82.58 - 61.85, 82.46 - 61.79, 82.17 - 61.72, 81.88 - 61.61, 81.61 - 61.51, 81.33 -…

Patrick
- 351
- 1
- 6
- 20
3
votes
1 answer
Rescale positive and negative numbers into [0, 1] and [-1, 0]
I have a data frame like this:
Input_df <- data.frame(Enl_ID = c("INTS121410", "INTS175899", "INTS171428", "INTS156006", "INTS196136", "INTS114771" ), `CN4244` = c(5, 0, -0.4, -0.6, 10, 2), `CN4249` = c(10, -4, -10, -2, 6, 0), `CN4250` = c(40, 10,…

SUMIT
- 563
- 4
- 12
3
votes
1 answer
Reshape a pandas DataFrame of (720, 720) into (518400, ) 2D into 1D
I have a DataFrame with shape: 720*720 2D. I wanna convert it to 1D dimension without changing its values. How can I do this using Pandas?

Kaveh P. Yousefi
- 165
- 1
- 2
- 13
3
votes
1 answer
python - rescale a value between two numerical ranges
I am trying to convert a value, comprised in the range of two integers, to another integer comprised in an other given range. I want the output value to be the corresponding value of my input integer (respecting the proportions). To be more clear,…

Knak
- 496
- 3
- 14
3
votes
2 answers
Scale KineticJS Stage with Browser Resize?
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…

Mitch
- 641
- 1
- 10
- 13