Winston.jl
Winston.jl copied to clipboard
no plot window with oplot
Demonstrated with the following code to plot multiple curves (Is this the right way to do it?). The plot window does not show, but with file("figure.png") the plots are saved to the file.
julia> Pkg.build("Winston")
INFO: Building Cairo
INFO: Building Tk
--------------------
using Winston
pw = FramedPlot()
for fname in fnames
mydata = readcsv(pathname * fname)
CumRet = mydata[:, 3]
x1 = [1:length(CumRet)]
oplot(x1, CumRet)
end
See http://winston.readthedocs.org/en/latest/fun/oplot.html
oplot
is used to add (overplot) things into an existing plot. First you have to create the plot by using the plot
command. Other option is to use the hold
http://winston.readthedocs.org/en/latest/fun/hold.html
Actually, this is a different problem: http://winston.readthedocs.org/en/latest/faq.html#why-is-nothing-displayed-when-i-call-plot-in-a-script
You can work around this by replacing pw = FramedPlot()
with pw = plot()
, and then calling display(pw)
after the for loop. But i need to come up with a better solution to this.
Ah sorry, my bad. However, what comes to the current repl vs script behaviour it is in my opinion, quite reasonable. Usually if I have a longer script that I run separately it also has many plot-calls that are to be saved in files. In this case it would not work to have many plot windows flashing on the screen. If I then want to explicitly see the window, I just specify it with the display
command.
For some reason this seems to raise lot of questions tho, so obviously something needs to be done. Maybe highlight this more in the manual?
Yeah, i don't want to change the current script behavior. But i do want to reduce the number of times that the repl doesn't appear to do anything.
yeah! use "display" will show the image !!!
i tried many things...
does it ok to add "display" or something else to readme?
In the REPL I need to do use display to see something with plot, both on windows and os x, is that the normal behavior or is it a bug ?