Graphics, Figures & TablesRendering an eps file?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
designguru
Posts: 3
Joined: Sat Apr 26, 2014 6:19 pm

Rendering an eps file?

Post by designguru »

Hi everyone,

I'm a designer trying to track down a way to achieve the rendering of an equation. I'm looking to recreate this...
image.png
image.png (63.52 KiB) Viewed 5718 times
The formula is this...
x = cos(7τ) and y = sin(11τ)

So I'm on the path to try and get this done and it has led here ;)

Is this simple or even possible to do in latex? If not please could you advise how to get the job done?

Thanks in advance for any help.

DG
Last edited by Stefan Kottwitz on Sun Apr 27, 2014 12:37 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Rendering an eps file?

Post by CrazyHorse »

Code: Select all

\documentclass{article}
\usepackage{pst-plot}
\begin{document}

\psset{unit=4}
\begin{pspicture}(-1.2,-1.2)(1.2,1.2)
\psaxes[labels=none,ticks=none]{->}(0,0)(-1.1,-1.1)(1.1,1.1)
\psparametricplot[algebraic,linecolor=red,plotpoints=1000,linewidth=1.5pt]{0}{11}{
  cos(7*t) | sin(11*t) }
\end{pspicture}

\end{document}
Run it with xelatex for a pdf or with latex->dvips -E for an eps image.
Attachments
xyz.png
xyz.png (30.2 KiB) Viewed 5728 times
Last edited by Stefan Kottwitz on Sun Apr 27, 2014 12:38 am, edited 1 time in total.
designguru
Posts: 3
Joined: Sat Apr 26, 2014 6:19 pm

Re: Rendering an eps file?

Post by designguru »

Thanks for taking the time crazy horse, much appreciated. You got it spot on.

To be honest it's an alien world to me, I only found this site by googling 'render math equation illustrator' and following a path of forum posts to even discover latex existed. Illustrator is terrible for that kind of thing and short of tracing it by hand (which would take a VERY long time) there's no real way to achieve that kind of effect so it's good to know it's possible for when the opportunity arises.
It's probably a lot for me to get my head around (installing and learning the program) right now. I'm having trouble even finding where to download it! ;)
http://latex-project.org/ftp.html ???

I still don't know the program's primary use or anything but now at least I know it's achievable.

If you get chance could you post a link to a file from latex (it could be a circle, anything really) just to see if the file it makes is compatible with illustrator. I'd hate to spend all that time working out how to use it to find it was outputting and invalid file type.

If not no worries and thanks again for the response.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Rendering an eps file?

Post by Johannes_B »

Hi, LaTeX is a program to »typeset beautiful books«. If you are having math in your document, LaTeX is the way to go. There are many more ways to get done what you want, but if there is any possibility that you have to do something like that again, use LaTeX. There is not only package pstricks, but also pgf. You can see some examples at TeXample and PsTricks.net.

You will need some time to learn, but it's time well invested.

The output of LaTeX is either dvi or pdf. You can convert dvi to pdf, and this should be compatible with illustrator ;-)

You can install LaTeX by installing TeX Live from TUG.

Additional hint: Click on »Open in writelatex« to compile the code of Crazyhorse.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Rendering an eps file?

Post by Stefan Kottwitz »

Hi DG,

welcome to the forum!

Another pretty short way would be using pgfplots.

Code: Select all

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
  \begin{axis}[ticks=none, axis x line=middle, axis y line=middle,]
    \addplot [domain=0:11,samples=1000] ({cos(deg(7*x))},{sin(deg(11*x))});
\end{axis}
\end{tikzpicture}
\end{document}
pgfplots-example.png
pgfplots-example.png (21.85 KiB) Viewed 5717 times
Just click on "Open in writeLaTeX" above the code to see it compiling.

Feel free to ask questions regarding installing and using LaTeX if you like. Just try to open separate topics for different questions, it's easier sorting things out then, and you will get the best possible help.

Stefan
LaTeX.org admin
designguru
Posts: 3
Joined: Sat Apr 26, 2014 6:19 pm

Re: Rendering an eps file?

Post by designguru »

Thanks for the warm welcome ;)

I've had some time to look into the program, it looks interesting and very useful. Naturally a lot of it is way over my head ;)

I tried the online install option, it was something like 3gb I seem to remember. That install failed, so I tried again with the basic option for 210Mb. Unfortunately that failed too on the installation of perl.exe.
I'm trying the on disc install but that's 2.4Gb so it going to be a while before I can try it out.

If I can't figure it out I'll make a post in the right forum ;)

DG
Post Reply