5 ms·
What workflow does everyone else use for generating a large number of plots? Personally, I've used both gnuplot and Veusz quite a bit. In gnuplot, my workflow
by kxyvr 9y ago
What workflow does everyone else use for generating a large number of plots?
Personally, I've used both gnuplot and Veusz quite a bit. In gnuplot, my workflow has been:
1. Write a bunch of scripts in Python or MATLAB/Octave to separate the data and output a large number of csv files
2. Write a gnuplot script to read the csv files to generate the appropriate plots
In Veusz, I combined step 1. and 2. into a single Veusz (.vsz) script.
At this point, I tend to default to gnuplot over Veusz because:
1. Complicated data parsing seems to render the Veusz GUI obsolete. The GUI seemed to be a nice learning tool, but it doesn't generate complicated loops or conditionals for parsing through data well.
2. Debugging Veusz scripts felt more difficult than it should be. At the end of the day, they're just Python files, but I didn't have access to the Python repl nor pdb. Perhaps there's a way to do, but I don't know how.
3. gnuplot seemed to do a better job generating plots that integrated in LaTeX documents. The epslatex terminal leaves the text to LaTeX, so we get uniform fonts across both the document and the plots, which is nice.
That said, Veusz generated gorgeous plots and I've been moderately happy with both. Mostly, I'm trying to figure out if anyone knows of either a better workflow and/or plotting program to generate a large number of plots to be included either as standalone images or part of a larger document in LaTeX.
- tmalsburg2 9y agoLearn R, use dplyr for data manipulation, make plots with ggplot2. I can hardly imagine a more powerful way to create graphs.
- throwaway7645 9y agoGgplot2 is nice if you're already working with R and data frames, but a lot of people would rather just use a scripting language to be the middleman between a database, CSV file, and language agnostic charting library like gnuplot, especially if you're not doing regression analysis or anything complex.
- leephillips 9y agoThe LaTeX integration is one place where gnuplot really shines, and is one of the main reasons I use it. Aside from the epslatex (or cairolatex) workflow, gnuplot works with tikz: you can generate tikz drawing commands with gnuplot, or call out to gnuplot from tikz/PGFplots. So, to answer your question, I don't know of a better tool for what you want to do. You can also pipe the data and plotting commands to gnuplot from any programming language that supports a socket interface. If you can forgive a plug, my new book about gnuplot is underway: https://alogus.com/publishing/gnuplot5/ https://alogus.com/publishing/gnuplot5/
- proctor 9y agohow much of the book is completed at this time?
- leephillips 9y agoFour chapters are available for download so far. That's about a third of the book.
- azag0 9y agoPython with pandas for data. Matplotlib and seaborn for plots. Export to PDF with the same font as used in the main document. If I need to include 3D graphics, I export the data from python to csv or json, and load in Wolfram Mathematica, which is extremely flexible for declarative composing of both 2D and 3D graphics.
- superdaniel 9y ago+1 for seaborn plots. Seaborn makes really pretty plots that are usually better than my lab-mates' in matlab.
- djmannion 9y agoI have found veusz to be great for this - by importing veusz, it becomes straightforward to integrate with other Python code. I have some tutorials on this approach here: http://www.djmannion.net/psych_programming/data/ http://www.djmannion.net/psych_programming/data/
- wodenokoto 9y agoWhat is the benefit to generate a CSV and then have a separate program build the plot, compared to just using matplotlib/seaborne directly from python?
- leephillips 9y agoSay you scale your problem up and write a Fortran program to run it on a supercomputer. You can then use that same plotting script, which is independent of the language that created the data.
- kxyvr 9y agoThat's basically it for me. Sometimes, I generate data from some very large programs and it's more practical and scalable to process that data outside of Python. In addition, most often, I put the plots inside of a LaTeX generated report or slides. In gnuplot, I can generate a piece of LaTeX code that will automatically match the fonts when the document changes. Does anyone know if the same functionality can be found in matplotlib or do we have to change the fonts by hand?
- xioxox 9y agoIf you're using veusz (https://veusz.github.io/ https://veusz.github.io/) then you can interactively modify your plot, changing the appearance and investigating relationships without writing or rerunning code. If your code takes a long time to run, you'll have to split your python code into two anyway: one part to do the calculation and the other to plot the results. Otherwise, it would take ages to modify plots. (I am the author of Veusz)
- xioxox 9y agoVeusz can be used from the Python repl. Just see some examples here: https://github.com/veusz/veusz/wiki/EmbeddingPython https://github.com/veusz/veusz/wiki/EmbeddingPython (I am the Veusz author - I'm glad you like the look of the output)
- kxyvr 9y agoThanks for the info! That does help quite a bit. I really have gotten a lot of mileage out of your packages, so I appreciate the hard work.