{
"cells": [
{
"cell_type": "markdown",
"id": "c7ba86b9-4c13-4780-b808-07dac354d663",
"metadata": {},
"source": [
"https://discourse.julialang.org/t/super-title-in-plots-and-subplots/29865"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "a6a687e6-b307-4495-9c6e-63732879cc7c",
"metadata": {},
"outputs": [],
"source": [
"using Plots\n",
"default(size = (400, 250))"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "07e6a730-040b-4087-9cd5-fbb0861807a8",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"A = plot(rand(10); label=\"A\")\n",
"B = plot(rand(10); label=\"B\")\n",
"C = plot(rand(10); label=\"C\")\n",
"D = plot(rand(10); label=\"D\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "9dc5a218-2561-4cf7-ad84-50b5b82c80dc",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "2cee5192-4188-4d75-9c0b-57dd4f8c6b23",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot(margin=0Plots.mm)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "d742e330-1138-4f73-9e8e-68b835c413d3",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"E = plot(framestyle=:none, margin=0Plots.mm)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "0cca27af-f7b8-4dc3-9307-81fc5411721f",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"F = plot(title=\"Plot Title\", framestyle=:none, margin=0Plots.px)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "62ad4fc1-7b9e-45b1-ab56-ee4dd7bae845",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"G = plot(title=\"Plot Title\", framestyle=:none, margin=0Plots.px, bottommargin=-50Plots.px)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "e4f6771a-161e-4ebc-819b-c827718359ff",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot(A, B, E, C; size=(600, 375), layout=(2, 2))"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "4024b86e-ab90-4c55-a84f-ee26ff3aa425",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot(F, A, B, C, D; size=(600, 400), layout=@layout[f{0.1h}; [a b; c d]])"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "9930f0c7-1014-48c3-9c7b-221505e91ca9",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot(G, A, B, C, D; size=(600, 400), layout=@layout[f{0.05h}; [a b; c d]])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c1489e56-f091-4cb2-89ea-36949e868d97",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.7.3",
"language": "julia",
"name": "julia-1.7"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}