scale

How do I scale the y-axis on a histogram by the x values in R?

淺唱寂寞╮ 提交于 2019-12-13 16:02:08
问题 I have some data which represents a sizes of particles. I want to plot the frequency of each binned-size of particles as a histogram, but scale the frequency but the size of the particle (so it represents total mass at that size.) I can plot a histogram fine, but I am unsure how to scale the Y-axis by the X-value of each bin. e.g. if I have 10 particles in the 40-60 bin, I want the Y-axis value to be 10*50=500. 回答1: You would better use barplot in order to represent the total mass by the area

Scale down (or crop) dialog background in Android

这一生的挚爱 提交于 2019-12-13 16:00:17
问题 I have a high res image (let's say 1900x1200), which I want to use as background for my dialog. It is created Dialog dialog = new Dialog(this); dialog.setContentView(R.layout.dialog); Dialog layout: <LinearLayout android:id="@+id/dialog" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > However, if I use this image, the Dialog (layout) is expanded to cover the image (or reach the full-screen, whichever is smaller). If I make the image

ImageButton Stretching Background Image

♀尐吖头ヾ 提交于 2019-12-13 14:24:10
问题 I am trying to create an ImageButton with no border but I am running into an issue with the sizing of the image button. Using Eclipse ADT I drag an ImageButton to the layout and select my background image. The image button appears as follows: As you can see there is a border between the background image and the image button perimeter which I would like to get rid of. To do so, I set the padding property to 0dp. The image button now looks like this: Finally, I set the scale type to fitXY:

Best method of scaling text to fill an HTML5 canvas

馋奶兔 提交于 2019-12-13 14:09:46
问题 I need to 'scale' text to fill an antire HTML5 canvas. It appears that the scale() method does not affect text. I've seen approximation methods with iterative loops on the measureText() method but this doesn't get me exactly what I need. Ideally I'd like to fill both horizontally and vertically without conserving the aspect ratio. Would SVG possibly be able to help with this? 回答1: My bad - Scale DOES apply to text. I've come up with a solution: context.font = "20px 'Segoe UI'"; var metrics =

“-webkit-transform: scale(2)” doesn't affect click area of Facebook Like Button (on iPad)

蓝咒 提交于 2019-12-13 12:57:29
问题 I've transformed size of iframe with like: iframe { transform: scale(2) !important; -webkit-transform: scale(2) !important; transform-origin: top left; -webkit-transform-origin: top left; } For all desktop browsers it works just fine, but in iPad Safari clickable area of links stay just the same size (look at third picture) Does anybody know how it can be fixed? 回答1: have you tried using the 'clip:' attribute? ie: clip: rect(3px 20px 5px 8px); Sorry if that's too much of a workaround. 来源:

background-size in different browsers

独自空忆成欢 提交于 2019-12-13 10:01:24
问题 I have some difficulties showing a scaled background on different browsers. I created the website on a Google chrome browser, but when loading the site on a iPhone or earlier version of IE, the background doesn't scale, or just doesn't show at all. I simply used the css code: background-size: 100% 150%; Then I changed it to: background-size: auto; But this still gives some troubles. Any idea how I could resize/scale this image on every browser and IE from version 6 to now? EDIT With the code

Online service to scale a website into a downloadable image?

若如初见. 提交于 2019-12-13 09:51:56
问题 Does anyone know of a service that will allow you to provide a URL that will rescale a graphic representation of that site and let you download the image. I need a scale image of a website to overlay on a smartphone graphic and I don't feel like jumping through hoops to get a screen shot from my phone. 回答1: http://www.shrinktheweb.com/. 回答2: Mobilito and mobiilisivutesti.fi use Browshot to take a screenshot on a mobile device, and retrieve a thumbnail. 回答3: If you need to do a lot of captures

Using transform scale causes blurry text only on Windows Chrome

半世苍凉 提交于 2019-12-13 08:42:42
问题 I have run into a pretty frustrating problem regarding the CSS transform scale . I have a block of text which I would like to zoom by 105% on hover and it is causing blurriness of the text, but only on the Windows version of Chrome. I found this question and tried the various solutions provided there, but I still cannot get it to work as desired. body, html { font-family:'Open Sans', sans-serif; } .zoom { transition:transform .5s; width:300px; margin:50px auto; } .zoom:hover { transform:

Plotting a line graph with scale.quantile()

别等时光非礼了梦想. 提交于 2019-12-13 06:35:45
问题 I am trying to plot a sorted array of normally distributed data so that it plots as straight line. I would like to do this using a cumulative density function, which I think is also known as a quantile function. Unfortunately, I haven't found many examples that use the quantile scale. Here is my attempt to use the quantile scale: http://jsfiddle.net/tbcholla/hmFqJ/3/. I set up my x scale this way: var x = d3.scale .quantile() .range(d3.range(0,width,1))//this will create an array from 0 to

Using input type=“range” to scale an image

我的未来我决定 提交于 2019-12-13 05:43:02
问题 What the title says. Is it possible? I want an image to scale up and down from it's center using a slider such as the input type="range". Thanks in advance! 回答1: <input id="ranger" type="range" min="1" max="100" value="100" /> <hr /> <img id="image" src="http://google.com/images/logo.png" width="275" height="95" /> var ranger = document.getElementById('ranger'), image = document.getElementById('image'), width = image.width, height = image.height; ranger.onchange = function(){ image.width =