Graphics, Figures & Tablespst-bar problem y-axis labeling

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

pst-bar problem y-axis labeling

Post by coachbennett1981 »

I am creating some bar charts using pst-bar feature and I am very new to this. I am trying to label the y axis in the below figure starting at 1000 and intervals of every 2000. The data chart was created in excel and I will put it with the file. How can I label the axis and keep my chart within the boundaries of the frame?

Any help is greatly appreciated and needed.

Code: Select all

\documentclass{article}
\usepackage{pstricks-add}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{color}
\usepackage{pst-bar}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\newcounter{lC}
\setcounter{lC}{1}


\begin{document}
\psset{lly=.6}%
\begin{pspicture}(0,-0.5)(3,3)%
\psset{xunit=1.5cm}
\psgrid[xunit=2in,gridlabels=0,%
subgriddiv=0,griddots=100](0,0)(1,5)%
\psaxes[axesstyle=frame,Ox=0,Dx=.5,Dy=2,dy=.25,labels=y,%
ticks=y](0,0)(6,6)%
\readpsbardata{\data}{figure5.csv}%
\psbarchart[barstyle={blue,red},barcolsep=.5]{\data}%
  \rput{360}(4.75,3.25){\textcolor{blue}{Car's Sold-in Hundreds}}
  \rput{360}(4.75,2.25){\textcolor{red}{Motorcycles Sold}}
  \rput{360}(3,5.5){\Large{First Quarter $\#$ of Car's Sold}}
\end{pspicture}

\end{document}



Attachments
figure5.csv
(62 Bytes) Downloaded 236 times
Last edited by coachbennett1981 on Tue Oct 12, 2010 1:44 pm, edited 2 times 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.

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

pst-bar problem y-axis labeling

Post by CrazyHorse »

coachbennett1981 wrote:I am creating some bar charts using pst-bar feature and I am very new to this. I am trying to label the y axis in the below figure starting at 1000 and intervals of every 2000. The data chart was created in excel and I will put it with the file. How can I label the axis and keep my chart within the boundaries of the frame?

Code: Select all

\documentclass{article}
\usepackage{pst-bar}
\usepackage{pstricks-add}

\begin{document}

\begin{pspicture}(-0.5,-0.5)(4,5)
\psgrid[gridlabels=0,subgriddiv=0,griddots=10](4,5)
\psaxes[axesstyle=frame,Dy=3,dy=1cm,ylabelFactor=\cdot10^3,
  labels=y,ticks=y](0,0)(4,5)
\readpsbardata{\data}{/tmp/figure5.csv}%
\psbarchart[barstyle={blue,red},barcolsep=.5,yunit=0.0003333]{\data}%
\rput[lb](4.75,3.25){\textcolor{blue}{Car's Sold-in Hundreds}}
\rput[lb](4.75,2.25){\textcolor{red}{Motorcycles Sold}}
\rput(3,5.5){\Large{First Quarter $\#$ of Car's Sold}}
\end{pspicture}

\end{document}
Herbert
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: pst-bar problem y-axis labeling

Post by coachbennett1981 »

Looks great. Is there a way the axes can be labeled without scientific notation?

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

pst-bar problem y-axis labeling

Post by CrazyHorse »

coachbennett1981 wrote:Looks great. Is there a way the axes can be labeled without scientific notation?
ylabelFactor=000
or write that the y axis is in multiple of thousends

Herbert
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: pst-bar problem y-axis labeling

Post by coachbennett1981 »

thank you for your help in this matter.
Post Reply