I am new to Latex and still trying to find my way around things. I am using the pgf-umlsd package to create a sequence diagram which traces out exchange of messages between functions. Due to space constraints, I need the width of the diagram to be as minimal as possible. Therefore, I am trying to rotate the label of the thread by about 30-45 degrees. Currently, this is what I could manage to come up with:
This is not the ideal diagram I want, since sometimes, if the function name is too long, it overlaps with the labels on the messages. I am using \rotatebox to achieve this.
What I want to achieve is a diagram like this: (Please excuse my poor editing skills!)
Essentially, I want to move the thread label so that it begins from the top of the thread and tilts upwards. How can I do this?
I am using pdflatex to generate a PDF rendering of the image. Here's the code I'm using:
\documentclass[tikz]{standalone}
\usepackage{graphics}
\usepackage{tikz}
\usepackage{pgf-umlsd}
\usepackage[T1]{fontenc}
\begin{document}
\begin{sequencediagram}
\tikzstyle{inststyle}=[]
\pgfumlsdunderlinefalse
\renewcommand{\newthread}[3][gray!30]{
\newinst{#2}{\rotatebox[x=25pt,y=25pt]{30}{#3}}
\stepcounter{threadnum}
\node [below of=inst\theinstnum,node distance=0.8cm]
(thread\thethreadnum) {};
\tikzstyle{threadcolor\thethreadnum}=[fill=none]
\tikzstyle{instcolor#2}=[fill=none]
}
\newthread{function\string_name\string_one}
{function\string_name\string_one}{}
\newthread{function\string_name\string_two}
{function\string_name\string_two}{}
\newthread{function\string_name\string_three}
{function\string_name\string_three}{}
\newthread{function\string_name\string_four}
{function\string_name\string_four}{}
\newthread{function\string_name\string_five}
{function\string_name\string_five}{}
\newthread{function\string_name\string_six}
{function\string_name\string_six}{}
\mess{function\string_name\string_one}{}{function\string_name\string_two}
\mess{function\string_name\string_two}{}
{function\string_name\string_three}
\mess{function\string_name\string_three}{}
{function\string_name\string_four}
\mess{function\string_name\string_four}{}
{function\string_name\string_five}
\mess{function\string_name\string_five}{}
{function\string_name\string_six}
\end{sequencediagram}
\end{document}
I tried adding options to the \rotatebox command and changing the origin but it did not help.
\tikzstyle
is deprecated.\tikzset
would be the recommended way now.