alpha

R ggplot geom_hex alpha transparency

落爺英雄遲暮 提交于 2019-12-05 11:28:59
I have tried to plot some log scale data with geom_hex() but I have a problem with alpha transparency setting. plot script; p <- ggplot(data =test,aes(x=f.log, y=d.log)) + geom_hex(aes(alpha=log(..count..)),fill="#000000")+ geom_hline(yintercept = 0, size = 0.5,color="red",linetype = 2) + geom_vline(xintercept = 0, size = 0.5,color="red",linetype = 2) + theme_bw() for log scale label correction; p +scale_y_continuous(labels =(math_format(10^.x)))+ scale_x_continuous(labels =(math_format(10^.x))) test data plot; Q1: How can I fix the legend label and scales? I used "alpha=log(..count..)",

详解Android动画之Tween Animation

送分小仙女□ 提交于 2019-12-05 11:13:54
前面讲了动画中的Frame动画,今天就来详细讲解一下Tween动画的使用。 同样,在开始实例演示之前,先引用官方文档中的一段话: Tween动画是操作某个控件让其展现出旋转、渐变、移动、缩放的这么一种转换过程,我们成为补间动画。我们可以以XML形式定义动画,也可以编码实现。 如果以XML形式定义一个动画,我们按照动画的定义语法完成XML,并放置于/res/anim目录下,文件名可以作为资源ID被引用;如果由编码实现,我们需要使用到Animation对象。 如果用定义XML方式实现动画,我们需要熟悉一下动画XML语法: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@[package:]anim/interpolator_resource" android:shareInterpolator=["true" | "false"] > <alpha android:fromAlpha="float" android:toAlpha="float" /> <scale android:fromXScale="float" android:toXScale="float" android

Blending with HTML background in WebGL

走远了吗. 提交于 2019-12-05 10:55:34
I am drawing flat colors and textures into WebGL canvas. My colors and textures have varying alpha values and I want them to be blended correctly. I want to have transparent background (they should be blended with HTML content, which is under canvas). In WebGL, I use gl.clearColor(0, 0, 0, 0); gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); gl.enable(gl.BLEND); It works correctly, when HTML background is black. But when I set a JPG pattern as a background of , I draw black triangle (alpha=1) and white triangle (alpha=0.5), I can see the background pattern in place where triangles intersect

Remove alpha channel from UIImage

瘦欲@ 提交于 2019-12-05 09:59:36
I use the following method to get a decompressed uiimage from file system. However the UIImageView is colored as red when I turn on the color blended layer, even though the UIImageView is set to Opaque. The images on file system don't have alpha channel. I tried set CGContextSetAlpha(bitmapContext, 1), but still has blended layer. Anyone know how to remove alpha channel when using CGContextDrawImage? - (UIImage *)decompressedImage { CGImageRef imageRef = self.CGImage; CGRect rect = CGRectMake(0.f, 0.f, CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); CGContextRef bitmapContext =