|
69 | 69 | "plot1 + plot2" |
70 | 70 | ] |
71 | 71 | }, |
| 72 | + { |
| 73 | + "cell_type": "markdown", |
| 74 | + "id": "1cee746c", |
| 75 | + "metadata": {}, |
| 76 | + "source": [ |
| 77 | + "Use `grid=\"x\"` to draw vertical lines or `grid=\"y\"` to draw horizontal lines only." |
| 78 | + ] |
| 79 | + }, |
| 80 | + { |
| 81 | + "cell_type": "code", |
| 82 | + "execution_count": null, |
| 83 | + "id": "91cb84f5", |
| 84 | + "metadata": {}, |
| 85 | + "outputs": [], |
| 86 | + "source": [ |
| 87 | + "import hvplot.pandas # noqa\n", |
| 88 | + "import hvsampledata\n", |
| 89 | + "\n", |
| 90 | + "df = hvsampledata.stocks(\"pandas\", engine_kwargs={\"index_col\" : \"date\"})\n", |
| 91 | + "\n", |
| 92 | + "plot1 = df.hvplot(group_label=\"Company\", grid=\"x\", width=400, title=\"grid='x'\")\n", |
| 93 | + "plot2 = df.hvplot(group_label=\"Company\", grid=\"y\", width=400, title=\"grid='y'\")\n", |
| 94 | + "\n", |
| 95 | + "plot1 + plot2" |
| 96 | + ] |
| 97 | + }, |
| 98 | + { |
| 99 | + "cell_type": "markdown", |
| 100 | + "id": "d426fda0", |
| 101 | + "metadata": {}, |
| 102 | + "source": [ |
| 103 | + "Additionally, `'dashed'`, `'dotted'`, `'dotdash'`, or `'dashdot'` can be suffixed to the `grid` string to achieve a non-solid line." |
| 104 | + ] |
| 105 | + }, |
| 106 | + { |
| 107 | + "cell_type": "code", |
| 108 | + "execution_count": null, |
| 109 | + "id": "7b76bff4", |
| 110 | + "metadata": {}, |
| 111 | + "outputs": [], |
| 112 | + "source": [ |
| 113 | + "import hvplot.pandas # noqa\n", |
| 114 | + "import hvsampledata\n", |
| 115 | + "\n", |
| 116 | + "df = hvsampledata.stocks(\"pandas\", engine_kwargs={\"index_col\" : \"date\"})\n", |
| 117 | + "\n", |
| 118 | + "solid_plot = df.hvplot(group_label=\"Company\", grid=\"x\", width=400, title=\"grid='x'\")\n", |
| 119 | + "for line_style in [\"dashed\", \"dotted\", \"dotdash\", \"dashdot\"]:\n", |
| 120 | + " non_solid_plot = df.hvplot(group_label=\"Company\", grid=f\"x_{line_style}\", width=400, title=f\"grid='x{line_style}'\")\n", |
| 121 | + " solid_plot += non_solid_plot" |
| 122 | + ] |
| 123 | + }, |
| 124 | + { |
| 125 | + "cell_type": "code", |
| 126 | + "execution_count": null, |
| 127 | + "id": "0cbb3df0", |
| 128 | + "metadata": {}, |
| 129 | + "outputs": [], |
| 130 | + "source": [ |
| 131 | + "import hvplot.pandas # noqa\n", |
| 132 | + "import hvsampledata\n", |
| 133 | + "\n", |
| 134 | + "df = hvsampledata.stocks(\"pandas\", engine_kwargs={\"index_col\" : \"date\"})\n", |
| 135 | + "\n", |
| 136 | + "plot1 = df.hvplot(group_label=\"Company\", grid=\"x\", width=400, title=\"grid='x'\")\n", |
| 137 | + "plot2 = df.hvplot(group_label=\"Company\", grid=\"y\", width=400, title=\"grid='y'\")\n", |
| 138 | + "\n", |
| 139 | + "plot1 + plot2" |
| 140 | + ] |
| 141 | + }, |
72 | 142 | { |
73 | 143 | "cell_type": "markdown", |
74 | 144 | "id": "7c6cc816-2cc3-4af6-94a5-ed04b3bfe3ce", |
|
0 commit comments