[pstricks] query from enterline re scatterplot datapoint labeling in pstricks

vkanetka at uoguelph.ca vkanetka at uoguelph.ca
Wed Sep 13 18:53:09 CEST 2006


Andrew:

This is one solution... but there might be better approaches than this..

Vinay

=================

\documentclass[12pt]{article}
\usepackage[dvips]{graphics}
\usepackage{pst-all}      % From PSTricks
\newpsobject{showgrid}{psgrid}{subgriddiv=1,griddots=10,gridlabels=6pt}
\begin{document}
\psset{xunit=.5cm,yunit=.2cm}
\begin{pspicture}(0,0)(15,80)%\showgrid
{\tiny  
\psaxes[tickstyle=bottom,ticks=all,Oy=0,Dy=5,Ox=0,Dx=1,labels=all]{<->}(0,0)(0,0)(15,80)}
\rput(2,    4){\tiny Benin}
\rput(4,    4){\tiny Congo}
\rput(2,    9){\tiny Zambia}
\rput(9,    5){\tiny Lesotho}
\rput(1,    7){\tiny Malagasy}
\rput(6,    7){\tiny Sierra Leone}
\rput(8,    5){\tiny Nigeria}
\rput(7,    5){\tiny Uganda}
\rput(5,    2){\tiny Comoros}
\rput(8,    5){\tiny Sudan}
\rput(2,    8){\tiny Kenya}
\rput(7,    10){\tiny Somalia}
\rput(4,    24){\tiny Zimbabwe}
\rput(4,    75){\tiny South Africa}
\end{pspicture}
\end{document}
==================
Quoting Andrew Enterline <ajenter at gmail.com>:

> all,
>
> i'm interested in creating an X-Y scatterplot in pstricks that enables me to
> automatically label the scattered data points with a label (in this case, a
> country).  i searched around, but experienced trouble locating an example.
> a sample data series is as follows:
>
> X    Y   Label
> 2    4    Benin
> 4    4    Congo
> 2    9    Zambia
> 9    5    Lesotho
> 1    7    Malagasy
> 6    7    Sierra Leone
> 8    5    Nigeria
> 7    5    Uganda
> 5    2    Comoros
> 8    5    Sudan
> 2    8    Kenya
> 7    10    Somalia
> 4    24    Zimbabwe
> 4    75    South Africa
>
> does anyone have any ideas?  i am grateful for any examples.
>
> thanks,
> andrew








More information about the PSTricks mailing list