LaTeX forum ⇒ Graphics, Figures & TablesPlotting non continuous data sets using psgraph

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

Plotting non continuous data sets using psgraph

Postby thibaulth » Tue Dec 05, 2017 6:48 pm

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:
  1. IWC=0.01.x IWC=0.01.y
  2. 16.0001 8.4811
  3. 15.9419 8.48252
  4. [...] [...]
  5. 33.6076 9.70003
  6. 33.3442 9.70005
  7.  
  8. 16.4308 8.4707
  9. 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:

  1. \documentclass[margin=3pt]{standalone}
  2.  
  3. \usepackage{pstricks-add, pst-eps}
  4. \usepackage{pict2e}
  5. \usepackage{pstricks,pst-plot}
  6. \usepackage{pst-poly}
  7. \usepackage{multido}
  8. \usepackage{lscape}
  9. \usepackage{pgfplots}
  10.  
  11. \begin{document}
  12. %===========================================
  13. %Open files
  14. %===========================================
  15. \readdata[ignoreLines=1]{\data}{IWC_0.01.txt}
  16. \readdata[ignoreLines=1]{\dataA}{IWC_0.2.txt}
  17. \readdata[ignoreLines=1]{\dataB}{IWC_0.5.txt}
  18. \readdata[ignoreLines=1]{\dataC}{IWC_1.txt}
  19. \readdata[ignoreLines=1]{\dataD}{IWC_2.txt}
  20.  
  21. %===========================================
  22. %Set Graph
  23. %===========================================
  24. \psset{llx=-35pt,urx=5pt,lly=-28.5pt,ury=5pt,%
  25. xAxisLabel=\Large Time (s),xAxisLabelPos={c,-24pt},%
  26. yAxisLabel=\Large Altitude (km),yAxisLabelPos={-33.5pt,c}}
  27. \pstScalePoints(1,1){}{}
  28. \begin{psgraph}[linewidth=.5pt,axesstyle=frame,xticksize=-3pt 0% 0 %0
  29. ,Dx=10,yticksize=-3pt 0% 0 %80
  30. ,Dy=2](00,0)(80,10){10cm}{6cm}
  31.  
  32. %===========================================
  33. %Plot
  34. %===========================================
  35. % ====== Ice Water Content contour lines
  36. \listplot[linecolor=blue,linewidth=.5pt]{\data}
  37. \listplot[fillstyle=solid,fillcolor=blue!20,linestyle=none]{\dataA}
  38. \listplot[fillstyle=solid,fillcolor=blue!40,linestyle=none]{\dataB}
  39. \listplot[fillstyle=solid,fillcolor=blue!60,linestyle=none]{\dataC}
  40. \listplot[fillstyle=solid,fillcolor=blue!100,linestyle=none]{\dataD}
  41.  
  42. \end{psgraph}
  43.  
  44. \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

Tags:

Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 8 guests