Skip to content

Commit

Permalink
Updated matplotlib's colormap
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatoliy Bilenko authored and Anatoliy Bilenko committed Jun 17, 2024
1 parent 7b67b9f commit 59b897c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions chronoscope/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@

def plot_timeline(timeline, y_pos: int):
y_pos_scaled = -Y_LINE_SPACING * y_pos
colors = cm.get_cmap("tab10").colors # type: ignore[attr-defined]

for current, current_tick in enumerate(timeline[:-1]):
next_tick = timeline[current + 1]
start_time, end_time = current_tick["time"], next_tick["time"]
event_label = current_tick["event"]

pt.hlines(y_pos_scaled, start_time, end_time, lw=4,
colors=colors[current % len(colors)])
colors=cm.tab10(current))
pt.text(start_time, y_pos_scaled, event_label, rotation=90)

if len(timeline[:]) == 1:
Expand Down
2 changes: 1 addition & 1 deletion system-test
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cmd_mkdb() {
cd test/
python3 -m venv ".env"
source ".env/bin/activate"
pip3 install ../dist/Chronoscope-0.0.1-py3-none-any.whl
pip3 install ../dist/Chronoscope-0.0.2-py3-none-any.whl
deactivate
.env/bin/chronoscope create --trace trace.txt
cd -
Expand Down

0 comments on commit 59b897c

Please sign in to comment.