State of Plotting Packages as of 2018/12/15


#15

@jleman I’m also a PhD scholar and had the exactly same questions as you have when I started evaluating julia for my research simulations.

From my experience, PyPlots.jl is the best one you can find if are a researcher. The underlying PyPlots python package is very stable and feature rich. I tried GR a few months back, but at that time it had some bugs (not able to zoom etc) which made is difficult to use for my research purposes. Gadfly produces beautiful plots, but there is no option (?) to move legend inside the figure. If you are publishing you results or writing a journal paper, figures with legends outside the plot area is bad as it consumes more space. With PyPlot, my experience is so far good. If you are in linux, use Julia’s Conda.jl for python and install PyPlots.jl. This will install pyplots with QT GUI which have several features over the default GTK GUI you get in linux.

Finally, I will say Plots.jl is also worth a try. As many others pointed out, the Plot Recipes provides an easy way for several common tasks.


#16

In Gadfly, the legend can be placed inside the plot. See this example.


#17

PGFPlotsX can do this nicely, eg see this example and others in the gallery. Also, for plots that end up in papers, you can export as TikZ/LaTeX and have the font style and size in plots compatible with the text.


#18

@Mattriks Thanks! This is great news! I didn’t know this is possible. I absolutely love the default aesthetics of gadfly plots. I will check it out again. :slight_smile:

@Tamas_Papp This is also amazing. Last time, I tried to do this with PyPlot and ended up generating a Tex file with more size than the corresponding pdf. Maybe next time I will give this a try. Thanks a lot for the info. :slight_smile:


#19

You can also edit plots with inkscape (in svg or pdf). I found it hard to make complex plots (with several panels, insets, etc.) with Gadfly without manual editing.


#20

Some anecdote you might find helpful concerning the current state as you are specifically asking about atom on windows 10.

Some of my students (atom on windows 10) encountered a situation where they could not get the plot to display consistently, often it would not update or most of the time not display at all. Might be an istance of this one or something else, I did not investigate in depth.

My personal workflow for years has been to use whatever plotting package works (usually gnuplot on linux :-), export a vector format (.svg or in olden times .fig) and then to move legends, labels and change fonts/ font sizes as I like later.
This is a very good suggestion if it is not possible to script/ automatize the plot generation completely and the vector format is small enough in size. Might be complete FEM meshes are a bit much for that, though.


#21

The display problems should be fixed in GR master. You can also use “native” plotting (GKSTerm on macOS, GKSQt on Linux/Windows) by setting the GKS_NO_GUI environment.


#22

But no zooming option in the viewer yet, correct?
Edit: The relevant issue is:


#23

@jonathanBieler There is discussion about stacking and inset plots in Gadfly here:


Please add any suggestions!


#24

Thank you, I will ask them to try it again. They have the problem on their private laptops (we provide linux machines they could use instead during class), so I have neither control nor can really debug this.


#25

I started with PyPlot, but switched to PGFPlotsX quite some time ago, because I found it easier to produce nice publication/presentation-ready plots. Now I use it almost exclusively and love its stability, the fantastic manual/documentation and its versatility (there is almost nothing you can’t do with it). I’m almost never bothered by the negative sides, which are that it may take a bit of time to render heavy plots and you only get the interactivity that your svg/pdf viewer allows. For interactivity I also like PlotlyJS.


#26

I found that 99% of the time PGFPlotsX is slow I am overplotting and would be better served with a different kind of plot. That said, up to 10k points I am usually fine, and that is already way too much on a plot.

Adding hexagonal bins in the form of a general Julia package that other packages can also use is on my (countably infinite) TODO list.


#27

I’d say all the discussion above proves my point nicely.


#28

I totally agree; PGFPlotsX isn’t slow for any reasonable plot I tried to produce so far. Sometimes I just try to plot too many points, when I am too lazy to preprocess data that would anyway be indistinguishable in the figure…

Hexagonal binning looks interesting.


#29

You can expect pan/zoom in the next GR release, hopefully in January …
gks


#30

Sounds promising! So I will give it a try for my new KiteViewer.jl project!


#31

Hi @jleman,

I would (of course) personally suggest you take a look at my own package: InspectDR.

Some sample plots

You can find the sample code to generate “Sample plots” in this directory:

You can even build “applets” using Blink/Electron (uses Google Chrome somehow):

…And you might appreciate that it was designed to generate annotated Bode Plots where the x-axes of the Mag & Phase values are tied together (same frequency axis as you pan/zoom into the plot):

Basic Info

The InspectDR package was developed with the intent of interactively examining the results of circuit simulation in the time domain.

  • Designed to be fast (both to load, and to plot).
  • Designed to deal with datasets > 1GB.
  • Designed for publication-quality ouptut (and readable design reviews).
  • Designed so you can interactively add markers to overlay delta/slope measurements directly on the plot.
  • Designed so you can interactively add H/V markers for annotation purposes.

Some issues:

  • You can only use InspectDR for your 2D line/scatter plot needs. You will need another package to do 3D/mesh plots.
  • InspectDR plots require a moderate amount of code to generate plots. It is mostly designed to be used from a “plotting script”.
  • If you wish to use InspectDR from the command line for interactive purposes, I suggest using it through the Plots.jl module. Plots.jl takes more time to load than InspectDR.jl by itself, but is significantly easier to use from the command line (REPL).

Other interesting tools for network analysis

I have also started developing tools that help manipulate network parameters & conversions between S, T , ABCD, G, H, Y, and Z:

It is part of a larger toolset called CData:

CData is library of tools to deal with things like parametric analyses (where you vary process corner, voltage, temperature, etc…) if that is something that you might need.

CData will allow you to run vectorized calculations on all of the corners simulataneously (and even plot all the corners simultaneously).

There are instructions on how to install these packages, but I have not released them to Julia’s “metadata” library - as I have with InspectDR.


#32

Another good option is using RCall.jl + ggplot2.

When need to generate descent plot, I will still use R. ggplot2 is capable of making all kinds of plots and it also has tons of examples and tutorials. The plots generated by ggplot2 is perfect to reports or journal papers.


#33

Thank you for the detailed reply. I will give it a try.


#34

Also, though a bit off topic: if you need to read in your simulated data from binary SPICE or PSF files, you can try:

#SPICE data reader:
julia> ] add SpiceData

#PSF data reader:
julia> ] add LibPSF

(They are also re-exported by CData using a slightly nicer interface/data structures, but you can use them directly if you wish)