0

I have major issues with the visualization of output while using Julia notebook. First, I cannot use PyPlot: when typing using PyPlot, I receive the following error message

This call to matplotlib.use() has no effect
because the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,or matplotlib.backends is imported for the first time.

(I followed the guide, and I intalled Anaconda).

So I tried to use Gadfly, but I cannot figure out how to use the same figure multiple times: in my code a function has to iteratively plot one point in the same plane Oxy, but the only way I can plot is using the command display(plot(x=...,y=)), and this plots on different figures. As far as I know, Gadfly does not support the command "hold on" as in Matlab because it should be automatic. Also, the command "display" is not really precise, as it just makes the figure appear at a random point in the output.

I am using version Julia 5.0 and I am on Mac OsX 10.12.

Thank you all for your help

user16296
  • 31
  • 5
  • You can try `Plots.jl`. It is a convenient interface to several plotting backends. The built in `plotly` backend might be all you are looking for. – jverzani Sep 22 '16 at 15:19
  • For PyPlot, you may set the default backend on the file [`matplotlibrc`](http://matplotlib.org/users/customizing.html) (to locate this file, open up a python console, `import matplotlib` and type `matplotlib.matplotlib_fname()`). Look for a line `backend : ...` and set it to one backend that works for you (on Windows/Anaconda 3, I choosed `backend : Qt5Agg` and it works for me). – Gomiero Sep 22 '16 at 18:28
  • Which "guide" did you follow to install anaconda? This is not necessary with Julia and may have actually made things a bit more tricky. – David P. Sanders Sep 23 '16 at 10:11
  • This is the guide I found [link](https://github.com/JuliaPy/PyPlot.jl) "MacOS 10.9 comes with Python and Matplotlib, but this version of Matplotlib defaults to with the Cocoa GUI backend, which is not supported by PyPlot. It also has a Tk backend, which is supported, but the Tk backend does not work unless you install XQuartz. Alternatively, you can install the Anaconda Python distribution (which also includes ipython and other IJulia dependencies)." – user16296 Oct 07 '16 at 11:07

0 Answers0