Graphics, Figures & TablesPSTricks | Discontinued Axes for Plot

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Vafaeimehr
Posts: 4
Joined: Fri May 25, 2012 1:53 am

PSTricks | Discontinued Axes for Plot

Post by Vafaeimehr »

Hi all.

Is there any way to plot a discontinued axis with the pstricks package?

For instance my data ranges from 15000 to 17000 and I want to get a diagram with y axis starting from 12000 instead of 0. In order to plot data, I prepare CSV files in following format:

Code: Select all

column1   column 2 
1           data1
2           data2
.             .
.             .
Any idea is appreciated.

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

PSTricks | Discontinued Axes for Plot

Post by localghost »

Show us your own efforts in form of code. Setting an origin for an axis is demonstrated in the pst-plot manual. If that doesn't help, provide a proper minimal example that clearly shows the problem(s) and give all necessary but only relevant information.


Thorsten
Vafaeimehr
Posts: 4
Joined: Fri May 25, 2012 1:53 am

PSTricks | Discontinued Axes for Plot

Post by Vafaeimehr »

This is the code I use for plotting the diagram:

Code: Select all

\begin{figure}[h]
   \psset{xunit=00.145cm,yunit=00.0071cm} 
\begin{pspicture}(-8,-240)(69,970)
\psaxes[axesstyle=axes, ticksize=-4pt 0pt, labelFontSize=\displaystyle, labels=x,labels=y, Dx=11,dx=11,Dy=200,dy=200, Oy=0]{->}(0,0)(69,970)
 \readdata{\dat}{file1.csv} 
  \dataplot[plotstyle=line,linewidth=0.5pt]{\dat}
\end{pspicture}
\end{figure}
Obviously, if I change the Oy=0 to , lets say, Oy=1000, it only changes the labeling range. however displayed diagram is the same as before, meaning that it is not magnified .

As an example suppose that data in file1 ranges from 1200 to 1500. Clearly when y ranges from 1000 to 1500 the plotted data should be scaled and looked different to what is plotted when y ranges from 0 to 1500. If I change Oy, diagram does not change and only labeling would change.
Last edited by Stefan Kottwitz on Wed Aug 08, 2012 1:02 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

PSTricks | Discontinued Axes for Plot

Post by localghost »

This loosely code snippet is useless. Please provide a proper minimal example as already requested.
Vafaeimehr wrote:[…] As an example suppose that data in file1 ranges from 1200 to 1500. […]
Why don't you just attach a sample CSV file to make your example self contained? Would be better instead of guesswork.
Vafaeimehr
Posts: 4
Joined: Fri May 25, 2012 1:53 am

PSTricks | Discontinued Axes for Plot

Post by Vafaeimehr »

Here is the code in detail and respective CSV file:

Code: Select all

\usepackage{pstricks}
\usepackage{pst-bar}


\begin{document}
 \begin{figure}[h]
\psframebox[framesep=1.2]
{ 
%  \centerline
%  {
  \psset{xunit=0.145cm,yunit=0.0071cm}
    
    \begin{pspicture}(-8,-240)(69,970)
      \psaxes[axesstyle=axes,           % Definition of x and y axes
              ticksize=-4pt 0pt,
              labelFontSize=\displaystyle,
              labels=x,
              labels=y,
              Dx=11,Dy=200,
              dx=11,dy=200,Oy=0,ticks=y,subticks=2,ticks=x,subticks=2]{->}(0,0)(69,970) 
       \psaxes[axesstyle=axes,           % Definition of x and y axes
              ticksize=-4pt 0pt,
              labelFontSize=\displaystyle,
              labels=x,
              labels=y,
              Dx=11,Dy=200,
              dx=11,dy=200,Oy=0,ticks=y,subticks=2,ticks=y,subticks=2]{->}(0,0)(69,970)                  
      \rput{90}(1,-156)  {\scriptsize  $01$/$10$/$2009$}
      \rput{90}(11,-156) {\scriptsize  $14$/$10$/$2009$}
      \rput{90}(22,-156){\scriptsize  $31$/$10$/$2009$}
      \rput{90}(33,-156){\scriptsize	 $16$/$11$/$2009$}
      \rput{90}(44,-156){\scriptsize  $30$/$11$/$2009$}
      \rput{90}(55,-156){\scriptsize  $15$/$12$/$2009$}
      \rput{90}(66,-156){\scriptsize  $31$/$12$/$2009$} %      \rput{90}(181,-70){\scriptsize	 $2002$}
     \rput(-10,426.6){\psrotateleft{\footnotesize Daily price developmnet in USD }}
      \readdata{\zahlen}{DFSTAS.csv}
      \dataplot[plotstyle=line,linewidth=0.5pt]{\zahlen}
    \end{pspicture}
    }
%  }

\caption{\footnotesize Daily price development}
\label{figure7}
\end{figure}%%

\end{document}
Attachments
DFSTAS.csv
(683 Bytes) Downloaded 194 times
Last edited by Stefan Kottwitz on Thu Aug 09, 2012 8:24 am, edited 1 time in total.
Post Reply