Skip to content

Commit c5a9b3f

Browse files
committed
:wrech: make text exportable as entire strings not characters
1 parent 993ae4e commit c5a9b3f

File tree

8 files changed

+38
-5
lines changed

8 files changed

+38
-5
lines changed

1_1_matplotlib.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
"import matplotlib as mpl\n",
2525
"import matplotlib.pyplot as plt\n",
2626
"import numpy as np\n",
27-
"import pandas as pd"
27+
"import pandas as pd\n",
28+
"\n",
29+
"mpl.rcParams['pdf.fonttype'] = 42\n",
30+
"mpl.rcParams['ps.fonttype'] = 42"
2831
]
2932
},
3033
{

1_1_matplotlib.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import numpy as np
1414
import pandas as pd
1515

16+
mpl.rcParams['pdf.fonttype'] = 42
17+
mpl.rcParams['ps.fonttype'] = 42
18+
1619
# %% [markdown]
1720
# ## Basic Line Plot
1821
# From Getting Started.

1_2_seaborn.ipynb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@
2323
"import os\n",
2424
"import pathlib\n",
2525
"\n",
26+
"import matplotlib as mpl\n",
2627
"import matplotlib.pyplot as plt\n",
2728
"import pandas as pd\n",
2829
"import seaborn as sns\n",
2930
"\n",
30-
"IN_COLAB = \"COLAB_GPU\" in os.environ"
31+
"IN_COLAB = \"COLAB_GPU\" in os.environ\n",
32+
"\n",
33+
"mpl.rcParams['pdf.fonttype'] = 42\n",
34+
"mpl.rcParams['ps.fonttype'] = 42"
3135
]
3236
},
3337
{
@@ -141,6 +145,9 @@
141145
"cell_metadata_filter": "-all",
142146
"main_language": "python",
143147
"notebook_metadata_filter": "-all"
148+
},
149+
"language_info": {
150+
"name": "python"
144151
}
145152
},
146153
"nbformat": 4,

1_2_seaborn.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010
import os
1111
import pathlib
1212

13+
import matplotlib as mpl
1314
import matplotlib.pyplot as plt
1415
import pandas as pd
1516
import seaborn as sns
1617

1718
IN_COLAB = "COLAB_GPU" in os.environ
1819

20+
mpl.rcParams['pdf.fonttype'] = 42
21+
mpl.rcParams['ps.fonttype'] = 42
22+
1923
# %% [markdown]
2024
# ## Proteomics data example
2125

1_3_seaborn.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"metadata": {},
2525
"source": [
2626
"Uses the data from [PXD04621](data/README.md) - using simulated data which looks\n",
27-
"similar to the original data \n",
27+
"similar to the original data\n",
2828
"([Marshall et. al. 2023)](https://www.sciencedirect.com/science/article/pii/S1756464623002451)).\n",
2929
"![figure_2](https://ars.els-cdn.com/content/image/1-s2.0-S1756464623002451-gr2.jpg)"
3030
]
@@ -60,6 +60,7 @@
6060
"import os\n",
6161
"from pathlib import Path\n",
6262
"\n",
63+
"import matplotlib as mpl\n",
6364
"import matplotlib.lines as mlines\n",
6465
"import matplotlib.pyplot as plt\n",
6566
"import numpy as np\n",
@@ -68,6 +69,9 @@
6869
"from matplotlib.ticker import MultipleLocator\n",
6970
"from sklearn.metrics import auc\n",
7071
"\n",
72+
"mpl.rcParams[\"pdf.fonttype\"] = 42\n",
73+
"mpl.rcParams[\"ps.fonttype\"] = 42\n",
74+
"\n",
7175
"IN_COLAB = \"COLAB_GPU\" in os.environ"
7276
]
7377
},

1_3_seaborn.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# %% [markdown]
2626
# Uses the data from [PXD04621](data/README.md) - using simulated data which looks
27-
# similar to the original data
27+
# similar to the original data
2828
# ([Marshall et. al. 2023)](https://www.sciencedirect.com/science/article/pii/S1756464623002451)).
2929
# ![figure_2](https://ars.els-cdn.com/content/image/1-s2.0-S1756464623002451-gr2.jpg)
3030

@@ -42,6 +42,7 @@
4242
import os
4343
from pathlib import Path
4444

45+
import matplotlib as mpl
4546
import matplotlib.lines as mlines
4647
import matplotlib.pyplot as plt
4748
import numpy as np
@@ -50,6 +51,9 @@
5051
from matplotlib.ticker import MultipleLocator
5152
from sklearn.metrics import auc
5253

54+
mpl.rcParams["pdf.fonttype"] = 42
55+
mpl.rcParams["ps.fonttype"] = 42
56+
5357
IN_COLAB = "COLAB_GPU" in os.environ
5458

5559
# %%

exercises/CRISPRi/figure_2.ipynb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@
2424
"source": [
2525
"import os\n",
2626
"\n",
27+
"import matplotlib as mpl\n",
2728
"import matplotlib.pyplot as plt\n",
2829
"import numpy as np\n",
2930
"import pandas as pd\n",
3031
"import seaborn as sns\n",
3132
"\n",
33+
"mpl.rcParams['pdf.fonttype'] = 42\n",
34+
"mpl.rcParams['ps.fonttype'] = 42\n",
35+
"\n",
3236
"IN_COLAB = \"COLAB_GPU\" in os.environ"
3337
]
3438
},

exercises/CRISPRi/figure_2.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# extension: .py
66
# format_name: percent
77
# format_version: '1.3'
8-
# jupytext_version: 1.17.2
8+
# jupytext_version: 1.18.1
99
# kernelspec:
1010
# display_name: Python 3
1111
# language: python
@@ -25,11 +25,15 @@
2525
# %%
2626
import os
2727

28+
import matplotlib as mpl
2829
import matplotlib.pyplot as plt
2930
import numpy as np
3031
import pandas as pd
3132
import seaborn as sns
3233

34+
mpl.rcParams['pdf.fonttype'] = 42
35+
mpl.rcParams['ps.fonttype'] = 42
36+
3337
IN_COLAB = "COLAB_GPU" in os.environ
3438

3539

0 commit comments

Comments
 (0)