|
64 | 64 | "import matplotlib.pyplot as plt\n",
|
65 | 65 | "import pandas as pd\n",
|
66 | 66 | "import spatialdata as sd\n",
|
67 |
| - "import spatialdata_plot\n", |
68 | 67 | "import squidpy as sq\n",
|
69 | 68 | "from shapely.geometry import Point\n",
|
70 | 69 | "from spatialdata.models import Image2DModel, ShapesModel, TableModel\n",
|
|
3467 | 3466 | ],
|
3468 | 3467 | "source": [
|
3469 | 3468 | "# subset the DataFrame to focus on a smaller region of the data\n",
|
3470 |
| - "subset_df = spot_df[\n", |
3471 |
| - " (spot_df[\"array_col\"].between(20, 30)) & (spot_df[\"array_row\"].between(20, 30))\n", |
3472 |
| - "]\n", |
| 3469 | + "subset_df = spot_df[(spot_df[\"array_col\"].between(20, 30)) & (spot_df[\"array_row\"].between(20, 30))]\n", |
3473 | 3470 | "\n",
|
3474 | 3471 | "# create the plot\n",
|
3475 | 3472 | "plt.figure(figsize=(10, 8))\n",
|
3476 | 3473 | "for _, row in subset_df.iterrows():\n",
|
3477 | 3474 | " x, y = row[\"spot_center_x\"], row[\"spot_center_y\"]\n",
|
3478 | 3475 | " label = f\"({row['array_row']},{row['array_col']})\"\n",
|
3479 |
| - " plt.text(x, y+30, label, fontsize=9, ha=\"center\", va=\"center\")\n", |
| 3476 | + " plt.text(x, y + 30, label, fontsize=9, ha=\"center\", va=\"center\")\n", |
3480 | 3477 | " plt.scatter(x, y, c=\"k\", alpha=0.4)\n",
|
3481 | 3478 | "\n",
|
3482 | 3479 | "# set plot limits and labels\n",
|
|
0 commit comments