Graphics, Figures & Tablespst-bar Scaling issue

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 Scaling issue

Post by coachbennett1981 »

Good morning, I am attaching the code I am using with the csv file as well. I am creating a bar-chart, but the values on the y-axis are to large and need to be scaled. I have re-labeled the y-axis to be able to show show the values, but I am unable to scale the figure properly, my y-values don't match the ones for the csv file..

For example, the "3rd grade" column the blue bar should be 14 and the red bar 7. As you can see I have scaled it, but the values are not correct.

Any help is appreciated. Here is the code.

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{unit=0.5in}%
\begin{pspicture}(0,-0.5)(3,3)%
\psset{xunit=1.5cm}
\psbarscale(.15){}
\psgrid[xunit=2in,gridlabels=0,%
subgriddiv=0,griddots=100](0,0)(1,5)%
\psaxes[axesstyle=frame,Ox=0,Dx=.5,Dy=5,dy=1.5,labels=y,%
ticks=y](0,0)(6,5)%
\readpsbardata{\data}{figure12.csv}%
\psbarchart[barstyle={blue,red},barcolsep=.5]{\data}%
  \rput{360}(4.75,3.25){\textcolor{blue}{Artwork the class produced}}
  \rput{360}(4.75,2.25){\textcolor{red}{Pieces Sold at the Art Festival}}
  \rput{360}(3,5.5){\Large{Hilary's Art Classes}}
\end{pspicture}
\end{document}
Attachments
figure12.csv
(62 Bytes) Downloaded 220 times
Last edited by coachbennett1981 on Wed Oct 13, 2010 1:43 pm, 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.

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

pst-bar Scaling issue

Post by CrazyHorse »

coachbennett1981 wrote:Good morning, I am attaching the code I am using with the csv file as well. I am creating a bar-chart, but the values on the y-axis are to large and need to be scaled. I have re-labeled the y-axis to be able to show show the values, but I am unable to scale the figure properly, my y-values don't match the ones for the csv file..

For example, the "3rd grade" column the blue bar should be 14 and the red bar 7. As you can see I have scaled it, but the values are not correct.

Code: Select all

\documentclass{article}
\usepackage{pst-bar}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\begin{filecontents*}{figure12.csv}
3rd Grade,4th Grade,5th Grade,6th Grade
13,26,28,20
7,24,20,14
\end{filecontents*}

\begin{document}

\psset{xunit=0.75in,yunit=0.1in}
\readpsbardata{\data}{figure12.csv}

\begin{pspicture}(-0.1,-0.1)(6,30)
\psgrid[gridlabels=0pt,griddots=5,subgriddiv=1](4,30)
\psaxes[axesstyle=frame,Dy=5,labels=y,ticks=y,
  yticksize=0 4,ticklinestyle=dashed,
  tickcolor=black!40](0,0)(4,30)%
\psbarchart[barstyle={blue,red},barcolsep=.5]{\data}%
\rput[lb](4.1,10){%
  \begin{tabular}{l}
    \textcolor{blue}{Artwork the class produced}\\
    \textcolor{red}{Pieces Sold at the Art Festival}\\[5mm]
    \Large Hilary's Art Classes
  \end{tabular}}
\end{pspicture}

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

Re: pst-bar Scaling issue

Post by coachbennett1981 »

Thank you for your help
Post Reply