[pstricks] How to use a csv-file for draw a piechart with package pstricks-add

José Jesús Rosell Escolar josejesus.rosell at gmail.com
Sun Nov 20 18:47:41 CET 2022


Hello every one
I usually use the packages pst-plot  for plotting bar diagram from a csv file.
In this moment I really want to plot a piechart, and the package pstricks-add has the command \psChart, but it is necessary to write the values by hand. 
My question is: is it possible to use a csv file for drawing a piechart within the command \psChart?

This is a short test than I created:
	\documentclass{article} %
	\usepackage{pst-plot} 
	 \usepackage{pstricks-add}
	
	\begin{document}
		\psreadDataColumn[ignoreLines=1]{2}{,}{\dada}{Datitos.csv}
			 \begin{pspicture}(-4,-4)(4,4) 
				 \psChart{\dada}{}{4} 
			\end{pspicture}
	\end{document}
And the file Datitos.csv is:
	Dato, Frecuencia
	1,4
	2,7
  	3,5
  	4,1
 	5,4
  	6,6


Thank you.


More information about the PSTricks mailing list.