Graphics, Figures & TablesPSTricks | Draw a Theatre Hall

Information and discussion about graphics, figures & tables in LaTeX documents.
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

PSTricks | Draw a Theatre Hall

Post by svend_tveskaeg »

Hi all.

I would like to create the drawing in the attached picture with PSTricks. (I do not use or know TikZ at all.)

I am able to do this, but it is going to be very painstaking work. How can I do it without too much work?
Theatre Hall
Theatre Hall
theatre-hall.jpg (36.27 KiB) Viewed 5367 times
Thank you in advance!
Last edited by cgnieder on Mon Sep 24, 2012 11:48 am, edited 1 time in total.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

PSTricks | Draw a Theatre Hall

Post by cgnieder »

Hi Svend,

Would mind showing us how you're doing it? Otherwise (I am sure you agree) it is impossible to show you a less painstaking way. I could come up with something but maybe it's even more complicated than your way, so...

Regards
site moderator & package author
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

PSTricks | Draw a Theatre Hall

Post by svend_tveskaeg »

Good point!

I have not actually any code yet, but my idea is to draw every red square using something like

Code: Select all

\documentclass{article}
\usepackage{auto-pst-pdf,pstricks-add}
\newcommand{\seat}[4]{\psline(#1,#2)(#1,#3)(#4,#3)(#4,#2)(#1,#2)}

\begin{document}

\begin{figure}
 \centering
 \psset{fillstyle=solid,fillcolor=red}
  \begin{pspicture}(1,1)
    \seat{0}{0}{1}{1}
  \end{pspicture}
 \label{theatre}
\end{figure}

\end{document}
and compile with

Code: Select all

pdflatex -shell-escape <filename>.tex
but it will take me a lot of time to make the drawing this way. :(

The rest of the drawing is no problem (I assume).
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

PSTricks | Draw a Theatre Hall

Post by localghost »

My idea would be to use the \psMatrixPlot command from the pstricks-add package.


Thorsten
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Re: PSTricks | Draw a Theatre Hall

Post by svend_tveskaeg »

@Thorsten: Good idea!

I do not understand where the squares come from.

Any change I can get someone to draw just a few squares for me? If I get the syntax, I can do the rest myself.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

PSTricks | Draw a Theatre Hall

Post by localghost »

I think Section 26 of pstricks-add manual will give you the right idea. I couldn't explain it better.
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Re: PSTricks | Draw a Theatre Hall

Post by svend_tveskaeg »

Thank you. I have already looked at page 82, though, without understanding it.

Just a small example to get me going would be much appreciated.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

PSTricks | Draw a Theatre Hall

Post by svend_tveskaeg »

@cgnieder:
Can I see your idea? (Just for the fun of it.)

As I already pointe out, a concrete example where the [color=#800000]\psMatrixPlot[/color] command is used will be much appreciated.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

PSTricks | Draw a Theatre Hall

Post by localghost »

svend_tveskaeg wrote:[…] As I already pointe out, a concrete example where the \psMatrixPlot command is used will be much appreciated.
And exactly such a concrete example can be found in the manual. So kindly have look at it, start a first approach and ask targeted questions in case that you run into trouble. m(
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

PSTricks | Draw a Theatre Hall

Post by cgnieder »

svend_tveskaeg wrote:@cgnieder:
Can I see your idea? (Just for the fun of it.)
I have never used pstricks before. My post should only be a teaser for you to show an own attempt :) . My idea would actually be a TikZ one (which you excluded):

Code: Select all

\documentclass{article}
\usepackage{tikz,etoolbox}
\usetikzlibrary{calc}

\colorlet{seat}{red!50!black!50}
\colorlet{mixer}{black}
\colorlet{stage}{brown}
\tikzset{
  seat/.style={
    draw           = seat,
    fill           = seat!75,
    minimum width  = 5pt,
    minimum height = 5pt
  },
  nonseat/.style={
    minimum width  = 5pt,
    minimum height = 5pt
  },
  mixer/.style={
    draw           = mixer,
    fill           = mixer!75,
    minimum width  = 5pt,
    minimum height = 5pt
  }
}

\makeatletter
\DeclareListParser*{\draw@row}{,}
\def\@draw@row#1{%
  \ifx#1x \node[seat]    {} ;\fi
  \ifx#1_ \node[nonseat] {} ;\fi
  \ifx#1m \node[mixer]   {} ;\fi
  \pgfmatrixnextcell}
\def\drawrow#1{\draw@row{\@draw@row}{#1}\\}
\makeatother

\def\emptyrow{\\[7pt]}
\begin{document}

\begin{tikzpicture}
 \matrix[draw,row sep=1pt,column sep=1pt] (auditorium) at (0,0) {
   \drawrow{x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x}
   \emptyrow
   \drawrow{x,x,_,_,x,x,x,x,x,x,x,x,x,x,x,x,x,_,_,x,x}
   \drawrow{x,x,_,_,x,x,x,x,x,x,x,x,x,x,x,x,x,_,_,x,x}
   \emptyrow
   \drawrow{_,x,x,_,_,x,x,x,x,x,x,x,x,x,x,x,_,_,x,x,_}
   \drawrow{_,x,x,_,_,x,x,x,x,x,x,x,x,x,x,x,_,_,x,x,_}
   \drawrow{_,x,x,_,_,x,x,x,x,x,m,x,x,x,x,x,_,_,x,x,_}
   \emptyrow
   \drawrow{_,_,x,x,_,_,x,x,x,x,x,x,x,x,x,_,_,x,x,_,_}
   \drawrow{_,_,x,x,_,_,x,x,x,x,x,x,x,x,x,_,_,x,x,_,_}
   \drawrow{_,_,x,x,_,_,x,x,x,x,x,x,x,x,x,_,_,x,x,_,_}
   \emptyrow
   \drawrow{_,_,_,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,_,_,_}
 };
 \draw[fill=stage]
   ($(auditorium.south west)+(13pt,-13pt)$) rectangle ($(auditorium.south east)+(-13pt,-28pt)$);
\end{tikzpicture}

\end{document}
theatre.png
theatre.png (1.62 KiB) Viewed 5359 times
Regards
site moderator & package author
Post Reply