area

Shading between vertical lines in MATLAB

◇◆丶佛笑我妖孽 提交于 2019-12-04 05:02:59
I'm sure this is a simple question, but I can't seem to figure it out. I've got this plot and I want to add vertical lines and shade the area in between to highlight areas of the data. I feel like I should be able to do this using the area function, but can't seem to figure it out. The dates and values are all doubles and are two separate vectors, if that makes a difference. Any help would be greatly appreciated. zellus Very basic example about shading an area in a plot. Shading an area boundered by a curve might be of interest as well. figure; ha = area([4 6], [10 10]); hold on plot(1:10, 1

Serialize a java.awt.geom.Area

半世苍凉 提交于 2019-12-04 04:20:15
问题 I have the need to serialize an Area object (java.awt.geom.Area) in a socket. However it doesn't seem to be serializable. Is there a way to do such thing? Maybe by converting it into a different object? Thanks in advance 回答1: I found this workaround: AffineTransform.getTranslateInstance(0,0).createTransformedShape(myArea) This results in a shape that can be serialized. 回答2: Use XStream to trivially convert it to/from XML. You don't need your object to implement particular interfaces, and the

android find pressure on screen

一个人想着一个人 提交于 2019-12-04 02:29:41
问题 I would like to roughly understand the amount of pressure the finger presses on the capacitive screen on android. My idea is to get the area covered by the finger when it is touched (maybe some extra parameters to get it more accurate, but thats the main idea). So, is there any way to find the are covered? (for example get the number of pixels covered). 回答1: There is only MotionEvent.getPressure() (which you probably already found). I doubt that there is something that reports how many pixel

Hover map area sprite with jquery

99封情书 提交于 2019-12-04 01:44:56
问题 I'm working on my first actual wordpress site and i'm having some troubles with some jquery. I really hope that someone can help me out here. So what i want to do is to position my div background depending on the map area currently hovered. I found an example here: http://ubytujnaslovensku.sk/sk/ What i got: HTML: <div id="front-cubus-wrapper"> <div id="front-cubus"></div> <div id="front-cubus-hover" style="background-position: 0px 0px;" ></div> <img alt="cubus" src="/wp-content/uploads/2013

Area covered by a point cloud with R

限于喜欢 提交于 2019-12-03 12:28:36
I have a cloud of points scattered in a 2D Euclidean space. I would like to calculate the area inside the polygon linking the most extreme (=peripheral) points of the cloud. In other words, I would like to estimate the area covered by the cloud in this space. Is there a formula in R? Thanks a lot for any response Julien This is called the convex-hull problem; R built-in chull function should do the work. To count area, you may use a formula from here . EDIT: Even better; splancs package has areapl function. So the function solving your problem should look like this: cha<-function(x,y){ chull(x

Find and replace all matching strings within textarea

馋奶兔 提交于 2019-12-03 05:46:21
I have this var textarea=$('#content'); textarea.html(textarea.html().replace("PID","111111")); This works partially, but it only finds the first "PID" within the textarea and replaces it to "1111111". There are about 7 others I need to change as well. What I need is a way to find ALL "PID" and replace it with "111111". Thanks in advance. Use regex to replace all the occurrences in a string. Try this textarea.html(textarea.html().replace(/PID/g,"111111")); textarea.html(textarea.html().replace(new RegExp("PID","g"),"111111")); the "g" modifier performs a global search. 来源: https:/

iOS how to calculate number of pixels/area enclosed by a curve?

做~自己de王妃 提交于 2019-12-03 03:13:55
I got an arbitrary shaped curve, enclosing some area. I would like to approximate the number of pixels that the curve is enclosing on an iPhone/iPad screen. How can I do so? A curve is defined as a successive x/y coordinates of points. A curve is closed. A curve is drawn by a user's touches (touchesMoved method), and I have no knowledge of what it looks like I was thinking of somehow filling the closed curve with color, then calculating the number of pixels of this color in a screenshot of a screen. This means I need to know how to programmatically fill a closed curve with color. Is there some

python scatter plot area size proportional axis length

拟墨画扇 提交于 2019-12-02 11:30:14
问题 I'm getting quite desperate about this, I couldn't find anything on the www so far. Here's the situation: I am working with Python. I have 3 arrays: the x-coordinates, the y-coordinates and the radius. I want to create a scatter plot with the given x- and y-coordinates. So far, everything works how I want it to. Here is what's bothering me: The circle size of each point in the scatter plot should be defined by the radius array. The the values of the coordinates and the radius are in same

python scatter plot area size proportional axis length

自闭症网瘾萝莉.ら 提交于 2019-12-02 06:45:15
I'm getting quite desperate about this, I couldn't find anything on the www so far. Here's the situation: I am working with Python. I have 3 arrays: the x-coordinates, the y-coordinates and the radius. I want to create a scatter plot with the given x- and y-coordinates. So far, everything works how I want it to. Here is what's bothering me: The circle size of each point in the scatter plot should be defined by the radius array. The the values of the coordinates and the radius are in same units. More explicitly: Let's assume I have a point at (1, 1) with radius 0.5 assigned. Then I want to get

resize image by area

岁酱吖の 提交于 2019-12-02 06:00:22
问题 I am trying to write a javascript function to resize an image based on a given area (or in my case (somewhat inaccurate) 'average dimension' since that's easier to think in terms of. Rather than feeding in maximum height and width, I want to feed in maximum area so that long or narrow images will appear visually to be roughly the same size. I'm getting really caught on the math aspect of it, though... just how to logic it, as I haven't done much math of late. Basically, given an aspect ratio