Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I rotate a pie chart with 50,50 distribution so that it is divided vertically rather than horizontally?

\documentclass{beamer}
\usepackage{multicol}
\usepackage{datapie}
\usetheme{Warsaw}
\begin{filecontents}{institutes.csv}
Name,Quantity
"ERD", 50
"NERD",50
\end{filecontents}
\begin{filecontents}{population.csv}
Name,Quantity
"ERD", 30
"NERD", 70
\end{filecontents}

\DTLloaddb{institute}{institutes.csv}
\DTLloaddb{population}{population.csv}

\begin{document}
\begin{frame}{Are all the gastroesophageal reflux disease patients same? }
\begin{exampleblock}
{All patients present with  heart burn \texttt{and/or} regurgitation of sour fluid in mouth }So all these patients are same with varying severity of symptoms?
\end{exampleblock}
\begin{itemize}
\item upper gastro-intestinal endoscopy 
\item 24 hour Ph-metry 
\end{itemize}
\end{frame}

%-------------------------------------------------------------------------------------------------------------------------
\begin{frame}{Endoscopy Data}
\begin{columns}{2}
\begin{column}{0.4\textwidth}
\begin{figure}[htbp]
\DTLpiechart{variable=\quantity,outerlabel=\name}{institute}{%
\name=Name,\quantity=Quantity}
\caption{Institute data} 
\end{figure}
\end{column}
\begin{column}{0.4\textwidth}
\begin{figure}[htbp]
\DTLpiechart{variable=\quantity,outerlabel=\name}{population}{%
\name=Name,\quantity=Quantity}
\caption{Population data}
\end{figure}
\end{column}
\end{columns}
\end{frame}
\end{document}
share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

You can set the starting angle of the first segment by the setting start=90. The value is 0 by default.

    \DTLpiechart{variable=\quantity,outerlabel=\name,start=90,radius=1.8cm,outerratio=1.1}{institute}{%
\name=Name,\quantity=Quantity}

I have made some other changes too in the settings so that the chart looks more good.

\documentclass{beamer}
\usepackage{multicol}
\usepackage{datapie}
\usetheme{Warsaw}
\begin{filecontents}{institutes.csv}
Name,Quantity
"ERD", 50
"NERD",50
\end{filecontents}
\begin{filecontents}{population.csv}
Name,Quantity
"ERD", 30
"NERD", 70
\end{filecontents}

\DTLloaddb{institute}{institutes.csv}
\DTLloaddb{population}{population.csv}

\begin{document}
\begin{frame}{Are all the gastroesophageal reflux disease patients same? }
\begin{exampleblock}
{All patients present with  heart burn \texttt{and/or} regurgitation of sour fluid in mouth }So all these patients are same with varying severity of symptoms?
\end{exampleblock}
\begin{itemize}
\item upper gastro-intestinal endoscopy
\item 24 hour Ph-metry
\end{itemize}
\end{frame}

%-------------------------------------------------------------------------------------------------------------------------
\begin{frame}{Endoscopy Data}
\begin{columns}
\begin{column}{0.5\textwidth}
\begin{figure}[htbp]
\DTLpiechart{variable=\quantity,outerlabel=\name,start=90,radius=1.8cm,outerratio=1.1}{institute}{%
\name=Name,\quantity=Quantity}
\caption{Institute data}
\end{figure}
\end{column}%
\hfill
\begin{column}{0.5\textwidth}
\begin{figure}[htbp]
\DTLpiechart{variable=\quantity,outerlabel=\name,start=90,radius=1.8cm,outerratio=1.1}{population}{%
\name=Name,\quantity=Quantity}
\caption{Population data}
\end{figure}
\end{column}
\end{columns}
\end{frame}
\end{document}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.