Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some simple formatting changes #52

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions notebooks/01_introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,21 @@
"fruits = [\"Apples\", \"Pears\", \"Nectarines\", \"Plums\", \"Grapes\", \"Strawberries\"]\n",
"years = [\"2015\", \"2016\", \"2017\"]\n",
"\n",
"data = {\"fruits\": fruits, \"2015\": [2, 1, 4, 3, 2, 4], \"2016\": [5, 3, 4, 2, 4, 6], \"2017\": [3, 2, 4, 4, 5, 3]}\n",
"\n",
"p = figure(x_range=fruits, height=250, title=\"Fruit Counts by Year\", toolbar_location=None, tools=\"hover\", tooltips=\"$name @fruits: @$name\")\n",
"data = {\n",
" \"fruits\": fruits,\n",
" \"2015\": [2, 1, 4, 3, 2, 4],\n",
" \"2016\": [5, 3, 4, 2, 4, 6],\n",
" \"2017\": [3, 2, 4, 4, 5, 3]\n",
"}\n",
"\n",
"p = figure(\n",
" x_range=fruits,\n",
" height=250,\n",
" title=\"Fruit Counts by Year\",\n",
" toolbar_location=None,\n",
" tools=\"hover\",\n",
" tooltips=\"$name @fruits: @$name\"\n",
")\n",
"\n",
"p.vbar_stack(years, x=\"fruits\", width=0.9, color=HighContrast3, source=data, legend_label=years)\n",
"\n",
Expand Down Expand Up @@ -287,9 +299,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "scipy-scipy-interactive-dataviz-bokeh",
"display_name": "bk-tutorial",
"language": "python",
"name": "conda-env-scipy-scipy-interactive-dataviz-bokeh-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -301,12 +313,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
},
"vscode": {
"interpreter": {
"hash": "0494a81e5f69860dcb844ce8e12eb9c88a7e813ddbfb0fbade72137f5ce45437"
}
"version": "3.13.1"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions notebooks/07_annotations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@
"\n",
"for i, (xlabel, ylabel) in enumerate(zip([0.5, 1.6, 2.8, 4.2], [0.95, 0.6, 0.5, 0.45])):\n",
" p.line(x, jv(i, x), line_width=3, color=PiYG[4][i])\n",
" p.add_layout(Label(text=r\"$$J_\" + str(i) + \"(x)$$\", x=xlabel, y=ylabel))\n",
" p.add_layout(Label(text=rf\"$$J_{i}(x)$$\", x=xlabel, y=ylabel))\n",
"\n",
"show(p)"
]
Expand All @@ -554,11 +554,11 @@
"\n",
"- Use of standard LaTeX delimeters of ``$$``. Other options are available.\n",
"- Use raw Python strings e.g. ``r\"$$\\alpha$$\"`` so that backslashes are interpreted as normal characters rather than control sequences. \n",
" - Raw strings can be used in conjunction with f-strings by using 'rf'.\n",
"- ``Div`` and ``Paragraph`` accept LaTeX for just part of their contents, but for all other elements the whole contents must be LaTeX.\n",
" - To put normal text in a LaTeX string use ``\\text{...}``.\n",
" - We are actively working on improvements in this area.\n",
"\n",
"\n",
"#### Where can LaTeX be used?"
]
},
Expand Down