Comments (4)
The fontsize
option is used in the \documentclass
command in the latex document. This supports 10pt, 11pt, and 12pt. Use this to set the font size of the axis labels. To change the font of the text labels, you can use the standard latex commands (for instance \Large
). Here's an example with timeline_kit_1.py
:
diff --git a/examples/timeline_kit_1.py b/examples/timeline_kit_1.py
index 8ebf35f..ec760ca 100644
--- a/examples/timeline_kit_1.py
+++ b/examples/timeline_kit_1.py
@@ -51,7 +51,7 @@ def main():
"dotColor": "#000000",
"labelBgColor": "#000000",
"linkColor": "#000000",
- "textFn": lambda x: str(x["time"].year) + " - " + x["text"],
+ "textFn": lambda x: "{\Large %s -- %s}" % (x["time"].year, x["text"]),
"labelPadding": {"left": 2, "right": 0, "top": 0, "bottom": 0},
"labella": {
"nodeHeight": 12,
from labella.py.
The nodeHeight
seems to be related to the distance between rows of labels (it's been a while since I wrote this package). You can however hack some more padding into the Latex labels using the \rule
command, here's an example:
diff --git a/examples/timeline_kit_1.py b/examples/timeline_kit_1.py
index ba1ccaf..1b787d9 100644
--- a/examples/timeline_kit_1.py
+++ b/examples/timeline_kit_1.py
@@ -44,6 +44,9 @@ def main():
},
]
+ textFn = (
+ lambda d: f"\\rule[-17pt]{{0pt}}{{40pt}}{d['time'].year} -- {d['text']}"
+ )
options = {
"margin": {"left": 40.5, "right": 20, "top": 20, "bottom": 20},
"initialWidth": 400,
@@ -52,7 +55,7 @@ def main():
"dotColor": "#000000",
"labelBgColor": "#000000",
"linkColor": "#000000",
- "textFn": lambda x: str(x["time"].year) + " - " + x["text"],
+ "textFn": textFn,
"labelPadding": {"left": 2, "right": 0, "top": 0, "bottom": 0},
"labella": {
"nodeHeight": 12,
Hope this helps, let's leave this issue open as a reminder to look into making this easier.
from labella.py.
That works well, thank you.
Heres are some references for those of us new to LaTeX standard font sizes: https://latex-tutorial.com/changing-font-size/
What do you think about the nodeHeight
? I see that they proportionally grow as the text size increases. Is it possible to make the timeline events have more real estate?
from labella.py.
I'll try that. Take care!
from labella.py.
Related Issues (15)
- Implement logscale
- textStyle example HOT 4
- borderColor not working HOT 3
- I think I'm missing something in my machine to run it but I don't know what. HOT 9
- Gantt chart HOT 2
- Horizontal Timeline up and down HOT 1
- Latexmk issue within Conda Env HOT 14
- FileNotFoundError: [WinError 2] The system cannot find the file specified
- How to use URL hyperlinks for timeline events? HOT 4
- import error HOT 3
- How to convert timeline to .png? HOT 5
- latexmk issue HOT 4
- OSError: [Errno 22] Invalid argument on dt2milli HOT 2
- Width caluculation - switch to TikZ? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from labella.py.