Layout Top Margin Problem

I’m trying to create plots that have no space inbetween.

Problem is after setting all available options, I still have space as shown in red:

See below for my layout JSON. Any idea what I can do to fix this ?

{
	"barmode": "overlay",
	"yaxis": {
		"title": {
			"text": null,
			"font": {
				"size": 12,
				"color": "rgb(0, 0, 0)"
			},
			"standoff": 12
		},
		"automargin": true,
		"visible": false,
		"showgrid": true,
		"gridcolor": "rgba(0, 0, 0, 0.1)",
		"zeroline": false,
		"exponentformat": "none",
		"tickfont": {
			"size": 12,
			"color": "rgb(0, 0, 0)"
		},
		"type": "linear",
		"range": [0, 1.0526315789473684],
		"autorange": true
	},
	"xaxis": {
		"title": {
			"text": null,
			"font": {
				"size": 12,
				"color": "rgb(0, 0, 0)"
			}
		},
		"automargin": true,
		"visible": false,
		"showgrid": false,
		"gridcolor": "rgba(0, 0, 0, 0.1)",
		"zeroline": false,
		"tickfont": {
			"size": 12,
			"color": "rgb(0, 0, 0)"
		},
		"nticks": 10,
		"type": "category",
		"range": [-0.5, 1.5],
		"autorange": true
	},
	"margin": {
		"autoexpand": true,
		"t": 0,
		"r": 0,
		"l": 0,
		"b": 0,
		"pad": 0
	},
	"height": 200,
	"hovermode": "x unified",
	"hoverdistance": 1,
	"font": {
		"family": "Segoe UI"
	},
	"showlegend": false,
	"legend": {
		"x": 0.5,
		"y": 1.295,
		"orientation": "h",
		"xanchor": "center",
		"yanchor": "top",
		"font": {
			"size": 12,
			"color": "rgb(0, 0, 0)"
		}
	},
	"paper_bgcolor": "rgba(255,255,255,0)",
	"plot_bgcolor": "rgba(255,255,255,0)",
	"hoverlabel": {
		"bgcolor": "rgb(202, 32, 32)",
		"bordercolor": "#FFFFFF",
		"font": {
			"color": "#FFFFFF"
		}
	},
	"width": 600
}

Found the problem… it was actually the plot that did not take up all space. Had to manually set the y axis range from min to max.

1 Like

Hi, Great you found the solution. Can you please mark your answer as the solution. Thx