How to make grids covered by figures? - grid-layout

I am new to RRDtool. I generated a graph with grid(--grid-dash 1:0), a LINE(LINE1:rt#4e9a06) and I also have the area between the line and the x-axis coloured (AREA:rt#4e9a06 ). I notice the grid still shows up in the colored-area. I am wondering if there is any way to cover the grid with the colored-area.
Also, I am also wondering if there is any good-looking rrdtool samples/examples available online? Thanks.

I have no way of testing this currently, but here's what the documentation says (emphasis mine) :
[-c|--color COLORTAG#rrggbb[aa]]
Override the default colors for the standard elements of the graph.
The COLORTAG is one of BACK background, CANVAS for the background of
the actual graph, SHADEA for the left and top border, SHADEB for the
right and bottom border, GRID, MGRID for the major grid, FONT for the
color of the font, AXIS for the axis of the graph, FRAME for the line
around the color spots, and finally ARROW for the arrow head pointing
up and forward. Each color is composed out of three hexadecimal
numbers specifying its rgb color component (00 is off, FF is maximum)
of red, green and blue. Optionally you may add another hexadecimal
number specifying the transparency (FF is solid). You may set this
option several times to alter multiple defaults.
What about making an almost transparent grid with arguments like these (note the extra 7F parameter which translates to 127 in decimal):
-c MGRID#<hex triplet>7F -c GRID#<hex triplet>7F
It should still be visible in the background but be invisible (or barely noticeable) once any graph covers it.
Note that this answer from the developer of RRDTool says that the grid is always painted after the graph, so in the end you'll always have it in the foreground, your only solution is to either totally disable it or tinker with color/transparency parameters to make it invisible when covered by the graphed data.

Related

Marking overlapping paths with off-color borders

Say I have an image of a rose which I want to trace:
I construct a few curvature shapes with it's stroke weight set to 5 like so:
Say I'd now like to see which stroke is placed over another, is there any way for me to do so?
Say my bottom layered stroke crosses a top layered stroke, it then might draw two little lines across the stroke like so:
Is there any way to set up such functionality? Or mimic it? It would help work like this a ton.
The program could get the order of overlap right by looking at the layer orders, which you would of course have to manually order yourself. But having a feature that enables me to see which shape is on top of which when they're overlapping would be great.

Qt3D transparency in offscreen renderer

I'm using Qt3D with a combination of this offscreen renderer and modified the framegraph to include a background image, like here.
Unfortunately, adding transparency to the objects drawn over the background image using QPhongAlphaMaterial only works unsatisfactorily.
This is th result:
What you can't see here is that the whole circle part is actually transparent, i.e. the renderer wrote the transparency value of the object for the whole pixel instead of adding it transparently on top of the background.
This is what the rendered object looks like wihtout transparency:
And this is the background:
The framegraph has two branches: one for the backgroun image, which is processed first, and one for the objects. I added a QRenderStateSet for the objects that contains a QBlendEquation with the blend function set to add and a QBlendEquationArguments with source RGB and alpha set to 1, and destination RGB and alpha set to 1 minus source alpha.
Any ideas how to fix this problem?
(For anyone wondering, I took the images from the T-Less dataset and wrote a program to create ground-truth data for 6D pose estimation)
Similarly to this question, the format of the texture that is being rendered to needs to be set to RGB8_UNorm and not RGBA8_UNorm, i.e. without the alpha channel.

ggplot2 "borders" of filled points

So first: I'm wholly new to programming and this is my second(?) week of R, so apologies in advance.
I'm using pch=21 and using a fill color to show a factor, but I'd like to control the border size of the points.
Is there any way to increase the border size of pch 21? Or is there another way of adding borders to points that will allow me to control border size?
ggplot(mpg, aes(x=model,y=cty))+
geom_point(color="black",size=3,pch=21,aes(fill=manufacturer))
The reason this is a problem is because I'd like to use white filled points on a white background (it's just a common style in my field), but they're too hard to see unless I make the black border more distinct.

FileModeWinding and DrawPath cause odd spikes to appear

I'm using gdiplus to "stroke" a textout. In certain circumstances, we see a "spike" appearing on the top or bottom of the graphic, and I'm not really sure why. We can minimize this by adjusting stroke width and font size, but thats not a good solution. I'm hoping someone can explain the problem to me.
And the code sample generating this 4, its outline, and the spike (unintentional)
GraphicsPath path(FillModeWinding);
path.AddString(text,wcslen(text),&fontFamily,StateInfo.TheFont.TheWeight,(REAL)minSize,PointF((REAL)ptStart.x, (REAL)ptStart.y),&sf);
// Draw the outline first
if (StateInfo.StrokeWidth > 0) {
Gdiplus::Color strokecolor(GetRValue(StateInfo.StrokeColor), GetGValue(StateInfo.StrokeColor), GetBValue(StateInfo.StrokeColor));
Pen pen(strokecolor,(REAL)StateInfo.StrokeWidth);
graphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias);
graphics.SetPixelOffsetMode(Gdiplus::PixelOffsetModeHighQuality);
graphics.DrawPath(&pen, &path);
}
// Draw the text by filling the path
graphics.FillPath(&solidBrush, &path);
Use Pen::SetLineJoin on the Pen you're using to draw the outline, and use something other than LineJoinMiter.
I agree that the fill mode isn't the issue, I think it is just the pen width used for drawing the outline. For characters that have enclosed spaces with pointy corners (like 4 and 'A'), as the pen width used for drawing the outline gets bigger, the size of the inner shape (the little triangle in the case of the four) gets bigger too.
Eventually the inner shape will get too big to be contained by the outer shape, and will start to poke through, resulting in the artifact you see.
Here is an illustration of a fixed font size (the Impact font again) as the outline width gets bigger. There is no fill here, just a call to graphics.DrawPath():
The fill operation doesn't care about the outline width, and uses the original shape of the letter.
This partially masks the problem by covering up some of the messy outline. Here is with the fill turned on:
Something similar will happen with the character 'A':
EDIT: calling SetLineJoin, as indicated in the other answer, is the way to stop this from happening.

NSTableView get rid blank space separating columns

I have an NSTableView with 4 columns. I also have a custom background color for each row. The only problem is I have these ugly white spaces where the gridlines would go in both the horizontal and vertical axis. I have both unchecked in IB, but they still show up. How can I get rid of the vertical ones and change the color and size of the horizontal ones?
Here's what I see:
alt text http://img815.imageshack.us/img815/9030/homex.png
To get rid of vertical spaces but keep the horizontal ones:
[yourTableView setIntercellSpacing:NSMakeSize(0.0, 2.0)];
See Apple documentation for more details.
You'll need to override drawClipInRect to draw your own grid. The article I linked to modifies it so it only draws vertical gridlines. You'll have to modify it to only draw horizontal ones instead, but the basic strategy is the same: By overriding it, you can make it not draw vertical lines by simply not including the code for it.

Resources