[pstricks] problem with def and dataplot (cyrille piatecki)

Denis Vergès denis.verges at wanadoo.fr
Sat Mar 28 15:52:12 CET 2015


Hello,
I think \usepackage{graphicx} is necessary with \scalebox or \psscalebox.

I put the data outside of the \pspicture}

I comment \end{figure} (in the end)

%%%%%%%%%%%
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{pstricks,pst-plot,pstricks-add}
\usepackage{graphicx}
\begin{document}
\begin{center}
\savedata{\hellcl}[
{{1, 0.840},
{2, 0.779},
{3, 0.704},
{4, 0.598}}]
\savedata{\hellcs}[
{{1, 0.529},
{2, 0.523},
{3, 0.582},
{4, 0.833}}]
\begin{pspicture}(0,0)(14,6)
\psgrid
\def\gu{
\psline{<->}(3,5)(3,2)(10,2)
\rput(10.2,2){\tiny $n$}
\rput(2.8,5){\tiny$\mathcal{H}$}
\rput(2.6,4.35){\tiny$0.840$}
\rput(9.5,3.35){\tiny$0.779$}
\rput(7.,4.05){\tiny$0.704$}
\rput(5.,4.3){\tiny$0.589$}
\rput(2.6,3.1){\tiny$0.529$}
\rput(5,3.3){\tiny$0.523$}
\rput(7,3.1){\tiny$0.582$}
\rput(9.5,4.3){\tiny$0.833$}
\rput(4,4.5){\tiny Greedy}
\rput(4,2.785){\tiny Simulation}

% 1\ = 10, 2 = 50, 3 = 100, 4 = 1000
\dataplot[origin={1,1}, xunit=2cm, 
yunit=4cm,showpoints=true,linecolor=red]{\hellcl}
\dataplot[origin={1,1}, xunit=2cm, 
yunit=4cm,linecolor=blue,showpoints=true]{\hellcs}
}
\rput(0,0){\psscalebox{0.8 0.8}{\gu}}
\end{pspicture}
\end{center}
%\end{figure}
\end{document}
%%%%%%%%%%%%
gives the plot.
Have a good day with PSTricks.
Denis
> Le 28 mars 2015 à 12:00, pstricks-request at tug.org a écrit :
> 
> \documentclass[12pt,a4paper]{article}
> \usepackage[utf8]{inputenc}
> \usepackage{pstricks,pst-plot,pstricks-add}
> \begin{document}
> \begin{center}
> \begin{pspicture}(0,0)(14,6)
> \psgrid
> \def\gu{
> \psline{<->}(3,5)(3,2)(10,2)
> \rput(10.2,2){\tiny$n$}
> \rput(2.8,5){\tiny$\mathcal{H}$}
> \rput(2.6,4.35){\tiny$0.840$}
> \rput(9.5,3.35){\tiny$0.779$}
> \rput(7.,4.05){\tiny$0.704$}
> \rput(5.,4.3){\tiny$0.589$}
> \rput(2.6,3.1){\tiny$0.529$}
> \rput(5,3.3){\tiny$0.523$}
> \rput(7,3.1){\tiny$0.582$}
> \rput(9.5,4.3){\tiny$0.833$}
> \rput(4,4.5){\tiny Greedy}
> \rput(4,2.785){\tiny Simulation}
> \savedata{\hellcl}[
> {{1, 0.840},
> {2, 0.779},
> {3, 0.704},
> {4, 0.598}}]
> \savedata{\hellcs}[
> {{1, 0.529},
> {2, 0.523},
> {3, 0.582},
> {4, 0.833}}]
> % 1\ = 10, 2 = 50, 3 = 100, 4 = 1000
> \dataplot[origin={1,1}, xunit=2cm, 
> yunit=4cm,showpoints=true,linecolor=red]{\hellcl}
> \dataplot[origin={1,1}, xunit=2cm, 
> yunit=4cm,linecolor=blue,showpoints=true]{\hellcs}
> }
> \rput(0,0){\psscalebox{.8 .8}{\gu}}
> 
> \end{pspicture}
> \end{center}
> \end{figure}
> \end{document}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20150328/d6bf9d65/attachment-0001.html>


More information about the PSTricks mailing list