
Aqui está um MWE. O \addmilestones
que está comentado no MWE é o problema. As datas reais que preciso são apresentadas no final de cada \addmilestone
comando. Além disso, a cor das bolhas deve variar em tons de vermelho, de acordo com o tamanho da bolha. Bolha pequena = vermelho claro, bolha maior = vermelho sangue.
A timeline
biblioteca pode ser encontrada emhttps://github.com/cfiandra/timeline
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{timeline}
\begin{document}
\begin{tikzpicture}[timespan={}]
% timespan={Day} -> now we have days as reference
% timespan={} -> no label is displayed for the timespan
% default timespan is 'Week'
\timeline[custom interval=true]{1966, 1971, 1979, 1980, 1981,1986,1996,2001,2006,2011,2016}
% \timeline[custom interval=true]{3,...,9} -> i.e., from Day 3 to Day 9
% \timeline{8} -> i.e., from Week 1 to Week 8
% put here the phases
\begin{phases}
\initialphase{involvement degree=0cm,phase color=black}
\phase{between week=1 and 1 in 0.5,involvement degree=1.65cm}
\phase{between week=2 and 3 in 0.5,involvement degree=3.5cm}
\phase{between week=3 and 4 in 0.5,involvement degree=0cm}
\phase{between week=4 and 5 in 0.5,involvement degree=0cm}
\phase{between week=5 and 6 in 0.5,involvement degree=0}
\phase{between week=5 and 6 in 0.5,involvement degree=2.5cm} Guerilla
\phase{between week=6 and 7 in 0.5,involvement degree=1.9cm}
\phase{between week=7 and 8 in 0.5,involvement degree=3cm}
\phase{between week=8 and 9 in 0.5,involvement degree =1.7cm}
\end{phases}
% put here the milestones
\addmilestone{at=phase-0.270,direction=270:2cm,text={Obote/UPC win First Multiparty elections},text options={below}} %1962
\addmilestone{at=phase-1.110,direction=90:2cm,text={Obote attacks President Mutesa palace},text options={above}}
\addmilestone{at=phase-2.110,direction=90:1.5cm,text={Idi Amin's Reign of Terror},text options={above}}
\addmilestone{at=phase-6.270,direction=270:1cm,text={Museveni Bush War},text options={below}}
\addmilestone{at=phase-7.110,direction=110:1.5cm,text={Northern Uganda War I},text options={above}}
\addmilestone{at=phase-8.90,direction=90:1.5cm,text={Northern Uganda War II},text options={above}}
\addmilestone{at=phase-9.60,direction=60:1.5cm,text={Northern Uganda War III},text options={above}}
%These are the problematic milestones I cannot get them placed at individual point dates, eg. 1966, 1971 etc...
%\addmilestone{at=phase-8.250,direction=240:1.5cm,text={Obote abrogates Constitution },text options={below}} % 1966
%\addmilestone{at=phase-8.250,direction=240:1.5cm,text={Idi Amin overthrows Obote },text options={below}} % 1971
%\addmilestone{at=phase-8.250,direction=240:1.5cm,text={Multiparty elections. Obote wins },text options={below}} % 1980
%\addmilestone{at=phase-6.170,direction=170:1.5cm,text={Museveni starts Bush war},text options={below}} % 1981
%\addmilestone{at=phase-6.170,direction=170:1.5cm,text={Okellos overthrow Obote II},text options={below}} 1985
%\addmilestone{at=phase-6.170,direction=170:1.5cm,text={Museveni seizes power from Okellos},text options={below}} 1986
%\addmilestone{at=phase-8.250,direction=240:1.5cm,text={``No party'' elections. Museveni wins },text options={below}} % 1996
%\addmilestone{at=phase-8.250,direction=240:1.5cm,text={``No party'' elections, Museveni wins },text options={below}} % 2001
%\addmilestone{at=phase-8.250,direction=240:1.5cm,text={Multiparty elections, Museveni wins },text options={below}} % 2006
\end{tikzpicture}
\end{document}
Responder1
Não tenho certeza se entendi corretamente, mas os nós que contêm os anos são nomeados como \timespan-\xi
, onde \timespan
está o que você define timespan={}
(ou seja, nada, no seu caso) e \xi
é um contador que começa em 1. Portanto, o nó de 1966, por exemplo é chamado -1
, então você pode colocar seu marco em, por exemplo -1.south
. Fiz os dois primeiros como exemplo, mas você mesmo pode preencher o resto. Não sei como você gostaria de colocar o texto:
Você pode notar que o círculo do marco não está exatamente centralizado no ano. A razão para isso é um espaço explícito no texto do nó, como você pode ver nas linhas98 e 102 emtikzlibrarytimeline.code.tex
. Adicionar opções draw=white
às opções do nó demonstra isso:
No entanto, você pode corrigir a \timeline
macro para remover o espaço, com
\usepackage{xpatch}
\xpatchcmd{\timeline}{\timespan\ \x}{\x}{}{}
Não tenho resposta para a parte colorida.
Código completo com patch aplicado:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{timeline}
\usepackage{xpatch}
\xpatchcmd{\timeline}{\timespan\ \x}{\x}{}{}
\begin{document}
\begin{tikzpicture}[timespan={}]
% timespan={Day} -> now we have days as reference
% timespan={} -> no label is displayed for the timespan
% default timespan is 'Week'
\timeline[custom interval=true]{1966, 1971, 1979, 1980, 1981,1986,1996,2001,2006,2011,2016}
% \timeline[custom interval=true]{3,...,9} -> i.e., from Day 3 to Day 9
% \timeline{8} -> i.e., from Week 1 to Week 8
% put here the phases
\begin{phases}
\initialphase{involvement degree=0cm,phase color=black}
\phase{between week=1 and 1 in 0.5,involvement degree=1.65cm}
\phase{between week=2 and 3 in 0.5,involvement degree=3.5cm}
\phase{between week=3 and 4 in 0.5,involvement degree=0cm}
\phase{between week=4 and 5 in 0.5,involvement degree=0cm}
\phase{between week=5 and 6 in 0.5,involvement degree=0}
\phase{between week=5 and 6 in 0.5,involvement degree=2.5cm}
\phase{between week=6 and 7 in 0.5,involvement degree=1.9cm}
\phase{between week=7 and 8 in 0.5,involvement degree=3cm}
\phase{between week=8 and 9 in 0.5,involvement degree =1.7cm}
\end{phases}
% put here the milestones
\addmilestone{at=phase-0.270,direction=270:2cm,text={Obote/UPC win First Multiparty elections},text options={below}} %1962
\addmilestone{at=phase-1.110,direction=90:2cm,text={Obote attacks President Mutesa palace},text options={above}}
\addmilestone{at=phase-2.110,direction=90:1.5cm,text={Idi Amin's Reign of Terror},text options={above}}
\addmilestone{at=phase-6.270,direction=270:1cm,text={Museveni Bush War},text options={below}}
\addmilestone{at=phase-7.110,direction=110:1.5cm,text={Northern Uganda War I},text options={above}}
\addmilestone{at=phase-8.90,direction=90:1.5cm,text={Northern Uganda War II},text options={above}}
\addmilestone{at=phase-9.60,direction=60:1.5cm,text={Northern Uganda War III},text options={above}}
%These are the problematic milestones I cannot get them placed at individual point dates, eg. 1966, 1971 etc...
\addmilestone{at=-1.south,direction=240:1.5cm,text={Obote abrogates Constitution },text options={below}} % 1966
\addmilestone{at=-2.south,direction=270:1.cm,text={Idi Amin overthrows Obote },text options={below}} % 1971
%\addmilestone{at=phase-8.250,direction=240:1.5cm,text={Multiparty elections. Obote wins },text options={below}} % 1980
%\addmilestone{at=phase-6.170,direction=170:1.5cm,text={Museveni starts Bush war},text options={below}} % 1981
%\addmilestone{at=phase-6.170,direction=170:1.5cm,text={Okellos overthrow Obote II},text options={below}} 1985
%\addmilestone{at=phase-6.170,direction=170:1.5cm,text={Museveni seizes power from Okellos},text options={below}} 1986
%\addmilestone{at=phase-8.250,direction=240:1.5cm,text={``No party'' elections. Museveni wins },text options={below}} % 1996
%\addmilestone{at=phase-8.250,direction=240:1.5cm,text={``No party'' elections, Museveni wins },text options={below}} % 2001
%\addmilestone{at=phase-8.250,direction=240:1.5cm,text={Multiparty elections, Museveni wins },text options={below}} % 2006
\end{tikzpicture}
\end{document}