fill

How to fill a Path in Android with a linear gradient?

不问归期 提交于 2019-11-27 05:11:32
问题 Given a closed Path object result is like this: Although that is a rectangle I'm looking for something which works with any closed Path. 回答1: While steelbytes' answer will probably give you more control over the individual sections of the gradient, you can do it without the path: protected void onDraw(Canvas canvas) { super.onDraw(canvas); Paint p = new Paint(); // start at 0,0 and go to 0,max to use a vertical // gradient the full height of the screen. p.setShader(new LinearGradient(0, 0, 0,

Highlight parts of matlab plot

六眼飞鱼酱① 提交于 2019-11-27 03:27:32
问题 I have a matlab plot that looks like this: Where the Y values for each of the subplots are stored in single dimensional arrays. What i would like to do is to find an area where the top graph is above a certain height say 0.5. I would also like to highlight the same area in the other graphs as well. Here is an example of what I am talking about: The best i have been able to find so far is the function area which will fill an area on the matlab grid. However, if someone could tell me how to

OpenCV closing a shape and filling it

末鹿安然 提交于 2019-11-27 02:43:44
问题 I want to output a blue-filled hand but get the incorrect output. I've included the input picture, incorrect output picture and code below. i think the code below does not fill the whole image because the image isn't closed yet at the right boundary. how do i close the shape and fill it with blue properly? #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> #include <stdio.h> #include <stdlib.h> using namespace cv;

Drawing a filled rectangle with a border in android

自作多情 提交于 2019-11-27 01:27:08
问题 Is there any way in Android to draw a filled rectangle with say a black border. My problem is that the canvas.draw() takes one paint object, and to my knowledge the paint object can't have a different color for the fill and the stroke. Is there a way around this? 回答1: You draw a rectangle with the color of the border and the size of the rectangle plus the border, you change the color of the paint and draw again the rectangle with the normal size. 回答2: Try paint. setStyle (Paint.Style. FILL )

Filling polygons of a map using GGplot in R

百般思念 提交于 2019-11-26 21:41:47
问题 For my school assignment I am trying to make a map of the Netherlands filled with a colour scale that is dependent of integer numbers (amount of citizens). I have a dataset called mun_neth which is a SpatialPolygonDataFrame and contains all polygons of the Netherlands and all the data that I want to plot. I have tried three different methods which I have added underneath. I also put the error messages underneath. I think I misunderstand the fill requirement. Where is it going wrong and how

Difference between “-webkit-text-fill-color” and “color”?

China☆狼群 提交于 2019-11-26 20:34:42
问题 I'm trying to understand the difference between -webkit-text-fill-color and just simply color ? Is there any functional difference? So far as I can tell, they're exactly the same.. Is there something you could do with one but not the other? 回答1: From the WebKit blog: text-fill-color – This property allows you to specify a fill color for text. If it is not set, then the color property will be used to do the fill. So yes, they are the same, but -webkit-text-fill-color will take precedence over

How to fill 100% of remaining height?

微笑、不失礼 提交于 2019-11-26 19:01:06
问题 +--------------------+ | | | | | | | | | 1 | | | | | | | | | +--------------------+ | | | | | | | | | 2 | | | | | | | | | +--------------------+ Contents of (1) as shown above are unknown, as it may increase or decrease in dynamically generated pages. The second div (2) as shown above, should fill the remaining space. here is an example of my html <div id="full"> <!--contents of 1 --> <div id="someid"> <!--contents of 2 --> </div> </div> css... #full{width: 300px; background-color: red;}

SVG fill color transparency / alpha?

拥有回忆 提交于 2019-11-26 17:55:24
问题 Is it possible to set a transparency or alpha level on SVG fill colours? I've tried adding two values to the fill tag (changing it from fill="#044B94" to fill="#044B9466"), but this doesn't work. 回答1: You use an addtional attribute; fill-opacity : This attribute takes a decimal number between 0.0 and 1.0, inclusive; where 0.0 is completely transparent. For example: <rect ... fill="#044B94" fill-opacity="0.4"/> Additionally you have the following: stroke-opacity attribute for the stroke

R::ggplot2::geom_points: how to swap points with pie charts?

限于喜欢 提交于 2019-11-26 17:25:49
问题 I would like to plot pie charts in two dimensions to show the composition of each point in terms of their composite "groups." So far, I'm using label repel to label to highest scoring points but it is still not great. I've looked around and I haven't seen what I'm looking for. ggplot(data=aggtmp2,aes(x=cluster,y=x,color=groups,shape=dataset)) + geom_jitter() + facet_grid(datasubset~.) + geom_text_repel(data=aggtmp2[aggtmp2$xnorm>.925,],aes(label=groups),size=2) > str(aggtmp2) 'data.frame':

Fill region between two loess-smoothed lines in R with ggplot

情到浓时终转凉″ 提交于 2019-11-26 08:25:18
问题 I\'d like to know how to fill the area between to loess-smoothed lines in ggplot. The following data frame is used for the pictures: x y ymin ymax grp ydiff 1 1 3.285614 3.285614 10.14177 min 6.8561586 2 1 10.141773 3.285614 10.14177 max 6.8561586 3 2 5.061879 5.061879 11.24462 min 6.1827368 4 2 11.244615 5.061879 11.24462 max 6.1827368 5 3 8.614408 8.614408 13.45030 min 4.8358931 6 3 13.450301 8.614408 13.45030 max 4.8358931 7 4 6.838143 6.838143 12.34746 min 5.5093150 8 4 12.347458 6.838143