alpha

MATLAB: how to save a geoshow figure with faceAlpha?

大憨熊 提交于 2019-12-24 06:04:21
问题 I am trying to save a figure in Matlab R2014a in which I want to plot data over an Image. This is the code: [Singapore, R] = geotiffread(file); s = size(Singapore); matrix = rand(s(1),s(2)); geoshow(Singapore(:,:,1:3), R) hold on geoshow(matrix, R, 'DisplayType', 'texturemap','facealpha',.2); xlim([103.605,104.04]) ylim([1.2,1.475]) This one is the plot that works perfectly: While when I am printing the figure print(gcf, '-dpng', fullfile(FileF, 'test.png')) the image is completely white 回答1:

alpha beta pruning in python

删除回忆录丶 提交于 2019-12-24 04:29:21
问题 In alpha, beta pruning algorithm, I have a class in which a function def getAction(self,gamestate) id defined. I made 2 more function in def getAction Like: class BAC: def you(self,gamestate): def me(gamestate,depth,alpha, beta): ------ return v def both(gamestate,depth,alpha, beta): ------------------- return v return me(gamestate,0,alpha, beta)- I need to put alpha, beta in functions me and both. But where do I define alpha and beta values. If I define alpha and beta in def me and def both

Semi-transparent (translucent) background color ignored in jasper reports pdf export

╄→гoц情女王★ 提交于 2019-12-24 03:54:14
问题 Q: Why is the alpha information lost when saving to PDF? Jaspersoft studio doesn't allow me to specify colors with alpha. So I tried to be clever and specified keys on my shading elements and changed the color in the code like so: JasperReport jasperReport = (JasperReport) JRLoader.loadObject(getClass().getResourceAsStream("/reports/Test.jasper")); ((JRStaticText) jasperReport.getGroups()[0].getGroupHeaderSection().getBands()[0].getElementByKey("bg")).setBackcolor(new Color(0, 0, 0, 30)); (

how to increase opacity in gaussian blur

a 夏天 提交于 2019-12-24 02:54:05
问题 I have a Java application where I need to draw text on top of an image. The text, the font, and the image are all determined at run time. The text needs to look nice, yet be readable (sufficiently contrastive) on top of the image. To meet these requirements, I create a drop shadow. This is done by drawing the text in opaque black, on a blank/transparent BufferedImage, then applying a Gaussian blur filter. I then draw the text again, in opaque white, on top of the drop shadow. So I have opaque

How can I draw transparent lines where the color becomes stronger when they overlap?

我是研究僧i 提交于 2019-12-23 09:48:05
问题 When you draw a bunch of transparent lines in matplotlib like this, you get a nice effect; when they overlap they are a bit darker. from pylab import * for _ in xrange(1000) : plot(np.random.randn(2),np.random.randn(2),alpha=0.1,color='k') show() It looks like this: But if you draw one long line like this that overlaps with itself like this, the line doesn't "interact with itself." It looks like this: I would like to draw a single curve that overlaps with itself, so that the more it overlaps

How can I draw transparent lines where the color becomes stronger when they overlap?

风流意气都作罢 提交于 2019-12-23 09:47:10
问题 When you draw a bunch of transparent lines in matplotlib like this, you get a nice effect; when they overlap they are a bit darker. from pylab import * for _ in xrange(1000) : plot(np.random.randn(2),np.random.randn(2),alpha=0.1,color='k') show() It looks like this: But if you draw one long line like this that overlaps with itself like this, the line doesn't "interact with itself." It looks like this: I would like to draw a single curve that overlaps with itself, so that the more it overlaps

Transparent PNG in a div tag, not using alpha?

蓝咒 提交于 2019-12-23 04:11:54
问题 I have an odd issue while beginning to learn CSS. This is a test page. It has a large transparent PNG covering the background color of solid blue. Typically the black image (which has transparent holes in it) completely blacks out my background color. In this example page I made the image's div transparent just to see if the background was still working. Any ideas why my alpha is getting completely ignored? Thanks all. 回答1: It's because on .backgrounddiv you have background-color set to #000

常用矩阵导数公式

笑着哭i 提交于 2019-12-22 18:09:48
1 矩阵\(Y=f(x)\)对标量x求导 矩阵Y是一个\(m\times n\)的矩阵,对标量x求导,相当于矩阵中每个元素对x求导 \[\frac{dY}{dx}=\begin{bmatrix}\dfrac{df_{11}(x)}{dx} & \ldots & \dfrac{df_{1n}(x)}{dx} \\ \vdots & \ddots &\vdots \\ \dfrac{df_{m1}(x)}{dx} & \ldots & \dfrac{df_{mn}(x)}{dx} \end{bmatrix}\] 2 标量y=f(x)对矩阵X求导 注意与上面不同,这次括号内是求偏导,\(X\)是是一个\(m\times n\)的矩阵,函数\(y=f(x)\)对矩阵\(X\)中的每个元素求偏导,对\(m\times n\)矩阵求导后还是\(m\times n\)矩阵 \[\frac{dy}{dX} = \begin{bmatrix}\dfrac{\partial f}{\partial x_{11}} & \ldots & \dfrac{\partial f}{\partial x_{1n}}\\ \vdots & \ddots & \vdots \\\dfrac{\partial f}{\partial x_{m1}} & \ldots & \dfrac{\partial f}{

calculate RGB equivalent of base colors with alpha of 0.5 over white background in matplotlib

陌路散爱 提交于 2019-12-22 10:33:55
问题 I would like to be able to replicate the look of a primary color ('r','g' or 'b') in matplotlib with an alpha of 0.5 over a white background, while keeping the alpha at 1. Here is an example below, where through manual experimentation I've found the RGB values that with an alpha of 1, look similar to matplotlib default colors with an alpha 0.5. I was wondering if someone had an automated way of achieving this. import matplotlib.pyplot as plt s=1000 plt.xlim([4,8]) plt.ylim([0,10]) red=(1,0.55

Setting alpha of colorbar in MATLAB R2015b

若如初见. 提交于 2019-12-22 10:13:08
问题 I would like to set some transparency in my plot which I can do with alpha . This works great but I also want to adapt the colorbar. Here is an example: subplot(2,1,1) A = imagesc(meshgrid(0:10,0:5)); alpha(A,1) colorbar subplot(2,1,2) B = imagesc(meshgrid(0:10,0:5)); alpha(B,.1) colorbar The example is taken from here. On this page two solutions exists but none works for Matlab R2015b. 回答1: With HG2 graphics (R2014b+) you can get some of the undocumented underlying plot objects and alter the