You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pr-12/notebooks/tutorials/scalebars.html
+34-11Lines changed: 34 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -351,7 +351,7 @@ <h2> Contents </h2>
351
351
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#units-and-auto-scaling">2. Units and auto-scaling</a></li>
352
352
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#placement-and-appearance-with-scalebar-params">3. Placement and appearance with <codeclass="docutils literal notranslate"><spanclass="pre">scalebar_params</span></code></a></li>
353
353
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#pinning-an-exact-bar-length">4. Pinning an exact bar length</a></li>
354
-
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#everything-else-and-on-real-data">5. Everything else, and on real data</a></li>
354
+
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#rotating-the-bar-and-adding-a-label">5. Rotating the bar and adding a label</a></li>
<p>Without <codeclass="docutils literal notranslate"><spanclass="pre">scalebar_dx</span></code> there is <strong>no scalebar</strong> — the plot has no way to know the physical size, and it never guesses. Two things worth remembering:</p>
@@ -450,7 +450,7 @@ <h2>2. Units and auto-scaling<a class="headerlink" href="#units-and-auto-scaling
<h2>5. Everything else, and on real data<aclass="headerlink" href="#everything-else-and-on-real-data" title="Link to this heading">#</a></h2>
538
-
<p>Because <codeclass="docutils literal notranslate"><spanclass="pre">scalebar_params</span></code> is forwarded to matplotlib-scalebar, anything that library supports (<codeclass="docutils literal notranslate"><spanclass="pre">rotation</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">width_fraction</span></code>, custom formatters, …) works too — see the <aclass="reference external" href="https://github.com/ppinard/matplotlib-scalebar">matplotlib-scalebar documentation</a> for the full list.</p>
539
-
<p>For a scalebar on a real dataset with a genuine micron-per-pixel value, see the <aclass="reference internal" href="../examples/visium_mouse_brain.html"><spanclass="doc">Visium mouse brain example</span></a>, which finishes with a publication-style figure.</p>
536
+
<sectionid="rotating-the-bar-and-adding-a-label">
537
+
<h2>5. Rotating the bar and adding a label<aclass="headerlink" href="#rotating-the-bar-and-adding-a-label" title="Link to this heading">#</a></h2>
538
+
<p>Two more <codeclass="docutils literal notranslate"><spanclass="pre">scalebar_params</span></code> round things out. <codeclass="docutils literal notranslate"><spanclass="pre">rotation</span></code> (<codeclass="docutils literal notranslate"><spanclass="pre">"horizontal"</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">"vertical"</span></code>) turns the bar on its side — useful when the free space in a panel is a tall strip rather than a wide one. <codeclass="docutils literal notranslate"><spanclass="pre">label</span></code> adds your own text alongside the automatic value, effectively a title for the bar, and <codeclass="docutils literal notranslate"><spanclass="pre">label_loc</span></code> (<codeclass="docutils literal notranslate"><spanclass="pre">"left"</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">"right"</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">"top"</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">"bottom"</span></code>) places it relative to the bar.</p>
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#units-and-auto-scaling">2. Units and auto-scaling</a></li>
629
652
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#placement-and-appearance-with-scalebar-params">3. Placement and appearance with <codeclass="docutils literal notranslate"><spanclass="pre">scalebar_params</span></code></a></li>
630
653
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#pinning-an-exact-bar-length">4. Pinning an exact bar length</a></li>
631
-
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#everything-else-and-on-real-data">5. Everything else, and on real data</a></li>
654
+
<liclass="toc-h2 nav-item toc-entry"><aclass="reference internal nav-link" href="#rotating-the-bar-and-adding-a-label">5. Rotating the bar and adding a label</a></li>
0 commit comments