[pstricks] [Fwd: Re: Kombination aus overpic und pstricks gesucht...]

Herbert Voss Herbert.Voss at alumni.TU-Berlin.DE
Mon Jun 2 18:42:02 CEST 2003


This is a copy from de.comp.text.tex

It shows an example where pstricks uses the same
units as the one from the package overpic.
The example image is available at
http://www.perce.de/LaTeX/hvfloat/rose.eps

Herbert



\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{overpic}
\usepackage{pst-plot}
\newsavebox{\IBox}
\newlength{\ILength}
%
\def\ScaleFactor{1.0}
\def\ScaleFactorPercent{100}
%
\begin{document}

\begin{figure}[!ht]
\centering
\sbox{\IBox}{\includegraphics{rose.eps}}
\begin{overpic}[grid, scale=\ScaleFactor,tics=10]{rose.eps}
    \setlength{\ILength}{%
      \ifdim\wd\IBox>\ht\IBox \wd\IBox
      \else \ht\IBox
      \fi%
    }
    \count1=\ILength
    \count2=\ScaleFactorPercent%
    \divide\count1 by 10000
    \multiply\count1 by \count2
    \dimen1=\count1 sp
    \put(99,28.5){U =18 kV}
    \put(52,34){\small 5 M$\Omega$}
    \put(17,55){(1)} % das ist overpic

%\psset{unit=\ScaleFactor cm} % das ist pstricks!
\psset{unit=\count1 sp} % das ist pstricks!
\psgrid[%
	subgriddiv=0,%
	griddots=5,%
	gridlabels=0pt,xunit=10,yunit=10](8,10)
\psaxes[%
	linewidth=1.2pt,%
	labels=none,%
	tickstyle=bottom,%
	Dx=10,Dy=10]{<->}(0,0)(100,120)
\rput(-0.5,0){0}
\end{overpic}
\caption{Maßstab 1:1}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\def\ScaleFactor{1.75}
\def\ScaleFactorPercent{175}
%
\begin{figure}[!ht]
\centering
\sbox{\IBox}{\includegraphics{rose.eps}}
\begin{overpic}[grid, scale=\ScaleFactor,tics=10]{rose.eps}
    \setlength{\ILength}{%
      \ifdim\wd\IBox>\ht\IBox \wd\IBox
      \else \ht\IBox
      \fi%
    }
    \count1=\ILength
    \count2=\ScaleFactorPercent%
    \divide\count1 by 10000
    \multiply\count1 by \count2
    \dimen1=\count1 sp
    \put(99,28.5){U =18 kV}
    \put(52,34){\small 5 M$\Omega$}
    \put(17,55){(1)} % das ist overpic

%\psset{unit=\ScaleFactor cm} % das ist pstricks!
\psset{unit=\count1 sp} % das ist pstricks!
\psgrid[%
	subgriddiv=0,%
	griddots=5,%
	gridlabels=0pt,xunit=10,yunit=10](8,10)
\psaxes[%
	linewidth=1.2pt,%
	labels=none,%
	tickstyle=bottom,%
	Dx=10,Dy=10]{<->}(0,0)(100,120)
\rput(-0.5,0){0}
\end{overpic}
\caption{Maßstab 1:1.75}
\end{figure}

\end{document}





More information about the PSTricks mailing list