Graphics, Figures & TablesPlotting non continuous data sets using psgraph

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
thibaulth
Posts: 1
Joined: Tue Dec 05, 2017 5:58 pm

Plotting non continuous data sets using psgraph

Post by thibaulth »

Hi all,

I've been doing my graphs until now using Igor Pro. But when I printed my manuscript, some of the output didn't go as I planned (bold fonts where it should be normal, linewidth going crazy and so on, ...)
Therefore, as I planned my defense, I started plotting graphs using PS tricks and pst-plot. I now want to expand it further and plot all my thesis graphs using PS tricks.

I have plotted my XY graphs without any problem as my data output correspond to simple variations (ie. continuous function of time).

I am now trying to plot a surface plot. I extract the data from Igor Pro (too heavy data to compute using LaTeX) to get the contour. This yields a two column file with x and y coordinates.
Here is the problem: my data looks like this:

Code: Select all

IWC=0.01.x IWC=0.01.y
16.0001   8.4811
15.9419   8.48252
[...]         [...]
33.6076   9.70003
33.3442   9.70005

16.4308   8.4707
16.3332   8.47344
The problem lies in this jump. When I compile the psgraph, a line is drawn from (33.34,9.7) to (16.43,8.47)... This wouldn't be the case is I used Gnuplot.

Here is what I have for the source code:

Code: Select all

\documentclass[margin=3pt]{standalone}

\usepackage{pstricks-add, pst-eps}
\usepackage{pict2e}
\usepackage{pstricks,pst-plot}
\usepackage{pst-poly}
\usepackage{multido}
\usepackage{lscape}
\usepackage{pgfplots}

\begin{document}
%===========================================
%Open files
%===========================================
\readdata[ignoreLines=1]{\data}{IWC_0.01.txt}
\readdata[ignoreLines=1]{\dataA}{IWC_0.2.txt}
\readdata[ignoreLines=1]{\dataB}{IWC_0.5.txt}
\readdata[ignoreLines=1]{\dataC}{IWC_1.txt}
\readdata[ignoreLines=1]{\dataD}{IWC_2.txt}

%===========================================
%Set Graph
%===========================================
\psset{llx=-35pt,urx=5pt,lly=-28.5pt,ury=5pt,%
		xAxisLabel=\Large Time (s),xAxisLabelPos={c,-24pt},%
		yAxisLabel=\Large Altitude (km),yAxisLabelPos={-33.5pt,c}}
\pstScalePoints(1,1){}{}
\begin{psgraph}[linewidth=.5pt,axesstyle=frame,xticksize=-3pt 0% 0 %0
				,Dx=10,yticksize=-3pt 0% 0 %80
				,Dy=2](00,0)(80,10){10cm}{6cm}

%===========================================
%Plot
%===========================================
% ====== Ice Water Content contour lines
	\listplot[linecolor=blue,linewidth=.5pt]{\data}
	\listplot[fillstyle=solid,fillcolor=blue!20,linestyle=none]{\dataA}
	\listplot[fillstyle=solid,fillcolor=blue!40,linestyle=none]{\dataB}
	\listplot[fillstyle=solid,fillcolor=blue!60,linestyle=none]{\dataC}
	\listplot[fillstyle=solid,fillcolor=blue!100,linestyle=none]{\dataD}
	
\end{psgraph}

\end{document}
Is there a way to make the data plot non-continuous using LaTeX? (I have changed my data file on the first graph to have what I want, given that I'm learning the correct use of psgraph, but for the remaining graphs, each containig contours, I'd rather have an automated way of doing this).

Thank you for your help!

--
Thibault

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply