Add space between title and plot in Bokeh - bokeh

How can I add space (or padding) between title and plot in bokeh?
There seem to be a offset attr but that offsets only horizontally. I also tried using <br/> and \n

p.title.vertical_align = 'top'

Related

Color Strip horizontal on Top with Image.plot in R

I am trying to put a color strip legend in the top of my plot using image.plot. The command horizontal=T in image.plot put it horizontally all right but on the bottom.
Thanks
Henri

How to align a label in Qt Designer without cutting the label content?

I'm trying to create a widget that will act as a navigation bar. It is formed by some buttons that are separated by arrows.
I'm trying to replicate this picture in Qt Designer using labels with the arrow character → . The problem is that this character is bigger than it seems so when I resize the container, the lower part of the arrow disappears.
I have tried to use the vertical layout using a vertical spacer to align the arrow character as the same height as the buttons but the character was cut anyways.
I can't reproduce your example by using just the standard settings.
I added two buttons and a label to the horizontalLayout and set the label font size to 55. I also set the text alignment to horizontal center and vertical center.
You will always have more space at the top cause this is the content of the ascii char.
Maybe it's better to use a simple icon?
EDIT:
You can also add a label or a button with a pixmap/icon which is resizeing with the window:

Reduce padding between axis labels and tick markers on Flex charts

I have a mx.charts.LineChart in Flex and I would like to know how to reduce the padding between the value labels and the tick markers? I've highlighted the region I mean with yellow boxes in the image below.
I'd like the labels to be as close as possible to the tick markers, just a couple of pixels will do.
I only care about applying this to the x-axis.
I'd also be interested to know how to reduce the padding between the axis title (e.g. kB and minutes on chart below) and the value labels.
Use the labelGap style of the AxisRenderer class.
By default it is 3 pixels, you can set it to 0 (or even a negative value if still not close enough).
For positioning the axis title there is no easy solution. You could write the vertical axis title yourself, as a label on top left of the chart. An advantage is that it is much better for the user to read (than the vertical writing).

Positioning ZedGraph legend at middle right not top right?

Is there some way to position the legend using ZedGraph so that it is on the right-hand side, but vertically centred. Using:
output.Legend.Position = ZedGraph.LegendPos.Right
positions the legend at the top right, but beside a pie chart this looks misaligned. Is there a way to get the legend to vertically centre?
Changing output.Legend.Location.Y seems to have no effect, nor does trying output.Legend.Location.AlignV = ZedGraph.AlignV.Center
Added in response to first answer below...
Floating, reducing the chart size and positioning the label does centre vertically, and is better than I had managed previously. Unfortunately it has a side-effect, in that the legend switches to multi-column and tries to occupy half the width of the total chart area, thus usually overlapping the chart (see picture). Looking at the ZedGraph source, this wider mode is used for all layouts except Left and Right.
Location is only enabled when Legend.Position is set to Float.
You could do like this (C#):
output.Legend.Position = LegendPos.Float;
output.Legend.Location =
new Location(1.05f, 0.5f, CoordType.ChartFraction, AlignH.Right, AlignV.Center);
with the probably undesired "feature" that the legend is drawn partially inside the chart:
To workaround this issue I believe you also have to manually resize your chart:
output.Chart.Rect = new RectangleF(xstart, ystart, xsize, ysize);
Anders' answer nearly worked, except it had the side-effect of changing the width of the legend. This led me to download the source code to find out why, and I discovered that the legend positioning code is actually quite trivial. LegendPos.Right is only referenced twice in the code, both times in Legend.CalcRect
Adding a new LegendPos.MiddleRight only needs it added to the enum, a case for MiddleRight added to the first Switch which runs the same code as Right. And in the second Switch in CalcRect the following:
case LegendPos.MiddleRight:
newRect.X = clientRect.Right - totLegWidth;
newRect.Y = tChartRect.Top + tChartRect.Height / 2 - totLegHeight / 2;
tChartRect.Width -= totLegWidth + gapPix;
break;
This is the same code as for LegendPos.Right except for the newRect.Y line.

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