border

matplotlib border width

白昼怎懂夜的黑 提交于 2021-01-16 06:09:00
问题 I use matplotlib 0.99. I am not able to change width of border of subplot , how can I do it? Code is as follows: fig = plt.figure(figsize = (4.1, 2.2)) ax = fig.add_subplot(111) ax.patch.set_ linewidth(0.1) ax.get_frame().set_linewidth(0.1) The last two lines do not work, but the following works fine: legend.get_frame().set_ linewidth(0.1) 回答1: You want to adjust the border line size? You need to use ax.spines[side].set_linewidth(size). So something like: [i.set_linewidth(0.1) for i in ax

matplotlib border width

倖福魔咒の 提交于 2021-01-16 06:07:56
问题 I use matplotlib 0.99. I am not able to change width of border of subplot , how can I do it? Code is as follows: fig = plt.figure(figsize = (4.1, 2.2)) ax = fig.add_subplot(111) ax.patch.set_ linewidth(0.1) ax.get_frame().set_linewidth(0.1) The last two lines do not work, but the following works fine: legend.get_frame().set_ linewidth(0.1) 回答1: You want to adjust the border line size? You need to use ax.spines[side].set_linewidth(size). So something like: [i.set_linewidth(0.1) for i in ax

Python - Create a text border with dynamic size

喜你入骨 提交于 2020-12-29 16:33:28
问题 I'm creating a command line script and I'd like there to be box... +--------+ | | | | | | +--------+ ... that will always fit its contents. I know how to do the top and bottom, but it's getting the ljust and rjust working correctly. There may be one string substitute per line, or 5, and the len of those strings could be anything between 0 and 80. I have been doing things like: print "|%s|" % (my_string.ljust(80-len(my_string))) But holy dang is that messy... And that's just one hardcoded

How can I change the border width and height so it wraps around the text?

有些话、适合烂在心里 提交于 2020-12-27 07:15:41
问题 I have the following webpage: Here is my code: When creating a header, does the border width tag go inside the <h1> tag or in a separate tag? I'm trying to make the border wrap around the header text in the middle of the page, instead of stretching to either side. 回答1: Use padding and display:inline-block; on a span tag. OR do it like this: span { padding: 10px; border: 5px solid black; display: inline-block; } <span>Is this long enough? Is this long enough? Is this long enough? Is this long

How can I change the border width and height so it wraps around the text?

流过昼夜 提交于 2020-12-27 07:14:03
问题 I have the following webpage: Here is my code: When creating a header, does the border width tag go inside the <h1> tag or in a separate tag? I'm trying to make the border wrap around the header text in the middle of the page, instead of stretching to either side. 回答1: Use padding and display:inline-block; on a span tag. OR do it like this: span { padding: 10px; border: 5px solid black; display: inline-block; } <span>Is this long enough? Is this long enough? Is this long enough? Is this long

How to create Rectangle With Gradient Color Stripes Border via CSS?

人走茶凉 提交于 2020-11-28 08:07:07
问题 I want to create Round Edges Rectangle With Gradient Color Stripes Border . I want to use the img tag or div tag to include the image and the Gradient Striped Border. This is how it needs to look like: I try to search around and i found that (SCSS) example: https://jsfiddle.net/rami7250/yujsz7wf/ and i got this SCSS code: .module { background: white; border: 1px solid #ccc; margin: 3%; > h2 { padding: 1rem; margin: 0 0 0.5rem 0; } > p { padding: 0 1rem; } /*animation: widen 10s linear

How to create Rectangle With Gradient Color Stripes Border via CSS?

若如初见. 提交于 2020-11-28 08:05:58
问题 I want to create Round Edges Rectangle With Gradient Color Stripes Border . I want to use the img tag or div tag to include the image and the Gradient Striped Border. This is how it needs to look like: I try to search around and i found that (SCSS) example: https://jsfiddle.net/rami7250/yujsz7wf/ and i got this SCSS code: .module { background: white; border: 1px solid #ccc; margin: 3%; > h2 { padding: 1rem; margin: 0 0 0.5rem 0; } > p { padding: 0 1rem; } /*animation: widen 10s linear

CSS decrease space between text and border

笑着哭i 提交于 2020-08-21 06:12:07
问题 When hovering a link I want it to get an underline. The underline should be 2px strong and 4px below the text. With text-decoration: underline I get a 1px strong line which is 4px below. (Distances vary by font) If I write border-bottom: 2px solid #000; I get a 2px line which is about 10px below the text. How can I decrease the distance between the text and the border? padding-bottom: -6px does not work. Any negative value with padding-bottom does not work. Or how can i get the underline to

Add border under column headers in QTableWidget

懵懂的女人 提交于 2020-08-07 06:27:04
问题 I have a table widget with two column header in a dialog that looks like this: There is a separation between the column headers named "Index" and "Label", but there is no separating border between these header and the row below them. How can this be added? Say the table is instantiated as: table = QTableWidget(6, 2, self) I know that I can get the first horizontal header as a QTableWidgetItem by doing headerItem = table.horizontalHeaderItem(0) modify some properties and set it back, but I'm