Graphics, Figures & Tablespst-plot | Unwanted x Axis Labels

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

pst-plot | Unwanted x Axis Labels

Post by svend_tveskaeg »

Hi all.

Consider the following MWE:

Code: Select all

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

\begin{document}

\begin{figure}
  \centering
  \savedata{\data}[{2,64},{4,32},{6,16},{8,8},{10,4},{12,2},{14,1}]
  \begin{pspicture}(10cm,10cm)
    \psset{xAxisLabel={},yAxisLabel={}}
    \begin{psgraph}[dx=2,Dx=2,Dy=10]{->}(0,0)(-0.5,-2.5)(15.5,79){10cm}{10cm}
      \psaxes[yAxis=false,ticks=none,labels=x,xLabels={,,A0,,A1,,A2,,A3,,A4,,A5,,A6,}](15.5,79)[Format,0][Antal ark A6-papir,90]
      \dataplot[plotstyle=dots,dotstyle=o,fillcolor=red]{\data}
    \end{psgraph}
  \end{pspicture}
\end{figure}

\end{document}
I am trying to avoid the numbers as x-axis labels and get only "A0",...,"A6" as x-axis labels. (I still want "10",...,"70" as y-axis labels.) What simple thing do I have to change?

I have tried to look at the pst-plot manual -- obviously without any luck. :?

Thank you in advance!
``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
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

pst-plot | Unwanted x Axis Labels

Post by svend_tveskaeg »

Hmm... It was a lot easier than what I first attempted.

Code: Select all

\documentclass{article}

\usepackage{pst-plot}

\begin{document}

\begin{figure}
\centering
 \savedata{\data}[{1,64},{2,32},{3,16},{4,8},{5,4},{6,2},{7,1}]
 \psset{yunit=0.1cm}
  \begin{pspicture}(8,80)
   \psaxes[Dy=10,xLabels={,A0,A1,A2,A3,A4,A5,A6}]%
     {->}(7.5,75)[Format,0][Antal ark A6-papir,90]
   \dataplot[plotstyle=dots,dotstyle=o,fillcolor=red]{\data}
  \end{pspicture}
\end{figure}

\end{document}
If someone can tell be when to use the psgraph environment and not, I would appreciate it.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Post Reply