Error messages when saving an image

Hi everybody,
I have found an error in VISAN (Windows 10, VISAN 4.0: Python 3.7.6, wxPython 4.0.4, VTK 8.2.0, NumPy 1.18.1, CODA 2.21, HARP 1.9.2). When I try to save an image from the World Plot or 2D Plot window, I cannot change the directory. Clicking on ‘Browse…’ gives the following error message:

Traceback (most recent call last):
File “D:\lenka-hp\soft\Anaconda3\envs\visan_env\lib\site-packages\visan\plot\typedsavefiledialog.py”, line 217, in OnBrowse
filename = wx.FileSelector(“Save As…”, default_path=directory, flags=wx.SAVE, parent=self)
AttributeError: module ‘wx’ has no attribute ‘SAVE’

Thus, the image can only be saved into the same directory as the data from which it was generated.

Thanks for reporting this.
I have created a ticket on github for it: https://github.com/stcorp/visan/issues/3
We will solve it for the next VISAN release.

1 Like

Good evening,
Speaking of saving the plots the wplot command creates, is there a way to do so from a script? so that it can be executed automatically [with executescript] and have the plots saved automatically, i.e. without user interaction?
I am ignorant as to the ways of python so if it can be done from python commands and it does not really on wplot I’ll ask a local python expert, thanks!
MariLiza

There is a way to save it using a python function:

w = wplot()
w.plotWindow.ExportToImageFile("/Users/sander/Desktop/test.png", "png")

However, be aware that you will always need to have a desktop environment open. The plotting functionality in VISAN does not allow you to do pure background creation of plots. The plotting functionality is primarily focused on interactive analysis.

Note that you can install other plotting libraries as well within your conda VISAN environment (such as matplotlib) and use those libraries to create plots that are more targeted towards publications.

2 Likes