Plotting error in Octave 6.3

408 views
Skip to first unread message

ajitab...@gmail.com

unread,
Oct 1, 2021, 12:04:58 AM10/1/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hello. I am running compositional module example
"compositionalExample3DSixComponents.m" . It works fine with Matlab.

Next, I tried with Octave 6.3 on both linux(ubntu 20.04) and windows 10. It makes the simulation run and draws first plot.

Then gives error in line 97 , i.e. plotToolbar . It seems path for icons is not set properly.

linux error:
error: imread: unable to find file 'home/user/mrst-2021b/modules/mrst-gui/icons/log10.gif'
error: called from
    imageIO at line 80 column 5
    imread at line 102 column 33
    plotToolbar>geticon at line 929 column 18
    plotToolbar at line 256 column 18

windows error:
error: __go_uicontrol__: set: invalid string property value for "string", unable to create graphics handle
error: called from
    uicontrol at line 122 column 8
    datasetSelector at line 154 column 9
    plotToolbar>addSelector at line 440 column 9
    plotToolbar at line 347 column 5

Thanks,
Ajit

Bård Skaflestad

unread,
Oct 1, 2021, 5:17:17 AM10/1/21
to ajitab...@gmail.com, MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hi,

 

Thanks for reporting the issue.  Would you be able to test a fix for us?  I'm afraid I don't currently have Octave 6.3 available on my local machine.  If you are able to test it, please replace the 'geticon' helper function in 'plotToolbar.m' (ca. line 921) with the revised implementation below and report back if you see any differences/improvements.

 

 

Best Regards,

 

Bård Skaflestad

SINTEF Digital, Mathematics & Cybernetics

Computational Geosciences group

 

 

function cdata = geticon(name)

    this_dir = fileparts(mfilename('fullpath'));

    icon = fullfile(this_dir, 'icons', [name '.gif']);

    [cdata, map] = imread(icon);

    if islogical(cdata)

        cdata = uint8(255*cdata);

    end

    map((map(:,1)+map(:,2)+map(:,3)==3)) = NaN;

    cdata = ind2rgb(cdata,map);

end

--
You received this message because you are subscribed to the Google Groups "MRST-users: The Matlab Reservoir Simulation Toolbox User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sintef-mrst...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sintef-mrst/e8dfa69b-ce9e-486e-973f-dbc0deb28de5n%40googlegroups.com.

Olav Møyner

unread,
Oct 1, 2021, 5:17:44 AM10/1/21
to ajitab...@gmail.com, MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi,

There might be some issue with the generated path for Octave, but even if that is fixed, interactive GUIs from MRST are not supported in Octave due to a missing feature on the Octave side. I know that there was an update that may fix this that will be a part of Octave 7.

Best regards,
Olav


From: sinte...@googlegroups.com <sinte...@googlegroups.com> on behalf of ajitab...@gmail.com <ajitab...@gmail.com>
Sent: Friday, October 1, 2021 6:04

To: MRST-users: The Matlab Reservoir Simulation Toolbox User Group <sinte...@googlegroups.com>
Subject: [MRST Users] Plotting error in Octave 6.3

ajitab...@gmail.com

unread,
Oct 1, 2021, 6:55:15 AM10/1/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hello Bard,

Your fix removed the 'geticon' error. Now both linux and windows give the same error, i.e.

error: __go_uicontrol__: set: invalid string property value for "string", unable to create graphics handle
error: called from
    uicontrol at line 122 column 8
    datasetSelector at line 154 column 9
    plotToolbar>addSelector at line 440 column 9
    plotToolbar at line 347 column 5

Any workaround for this 'uicontrol' error.

Regards,
Ajit.

Bård Skaflestad

unread,
Oct 1, 2021, 7:27:03 AM10/1/21
to ajitab...@gmail.com, MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hi,

 

Thanks for reporting back.  I'll make sure that that fix makes it into the MRST development sources and future MRST releases too.  As for the other problem, I notice that there's a UI control statement that violates the documented requirements of the MATLAB's 'uicontrol' function.  We're passing an array of integers to the 'String' property, but according to the documentation we're supposed to pass a cell array of character vectors instead.

 

Would you mind testing if replacing

 

    'String', 1:nsets, …

 

with

 

    'String', arrayfun(@(i) sprintf('%d', i), 1:nsets, 'UniformOutput', false), ...

 

in the 'uicontrol' call of 'addSelector.m' (ca. line 157) allows you to get further in the example when running on Octave.  Of course, we must remember Olav's warning concerning interactive controls in Octave so this may not be sufficient to solve the general case.

 

 

Best Regards,

 

Bård Skaflestad

SINTEF Digital, Mathematics & Cybernetics

Computational Geosciences group

 

ajitab...@gmail.com

unread,
Oct 1, 2021, 8:34:19 AM10/1/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hello Bard,

Your fixes have solved the two issues. Now it is working fine for Octave as well.
I think you wanted to say 'datasetSelector.m' file (line 157) for your second fix, rather than 'addSelector.m' file.

Some menu controls on the second plot are working fine, but there is issue with 'ijk slice' (i.e. pick logical indices). It gives similar error:

error: __go_uicontrol__: set: invalid string property value for "string", unable to create graphics handle
error: called from
    uicontrol at line 122 column 8
    plotToolbar>limitLogical at line 669 column 8

Also, the menu option next to it, i.e. "slice the figure. Click two times" is not working. But it does not throw any error.

Could you suggest any fix.
Thanks again!

Regards,
Ajit.

Bård Skaflestad

unread,
Oct 1, 2021, 8:55:53 AM10/1/21
to ajitab...@gmail.com, MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Hi,

 

You've identified three more instances of the same problem (passing an array of integers to a UI control property that expects a cell array of character vectors).  Please replace the assignments to 'si', 'sj', and 'sk' on lines 669 through 673 of 'plotToolbar.m' with the statements below.  I believe that these are all of the remaining instances of this issue, but I may have overlooked something.

 

 

Best Regards,

 

Bård Skaflestad

SINTEF Digital, Mathematics & Cybernetics

Computational Geosciences group

 

 

    integer_labels = @(arr) arrayfun(@(i) sprintf('%d', i), arr, 'UniformOutput', false);

 

    si = uicontrol(fi, 'Position', [0,   40, 100, 300], 'String', integer_labels(1:Mv(1)) , 'Style', 'listbox', 'Max', Mv(1), 'Value', logicalsubset.i, 'TooltipString', 'I');

    sj = uicontrol(fi, 'Position', [100, 40, 100, 300], 'String', integer_labels(1:Mv(2)) , 'Style', 'listbox', 'Max', Mv(2), 'Value', logicalsubset.j, 'TooltipString', 'J');

    if G.griddim == 3

        sk = uicontrol(fi, 'Position', [200, 40, 100, 300], 'String', integer_labels(1:Mv(3)) , 'Style', 'listbox', 'Max', Mv(3), 'Value', logicalsubset.k, 'TooltipString', 'K');

ajitab...@gmail.com

unread,
Oct 1, 2021, 9:44:04 AM10/1/21
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Thanks a lot!. With these fixes, code is working fine for Octave6.3 in Windows and Linux. Code is also working fine with Matlab in windows.

Regards,
Ajitabh.

Bård Skaflestad

unread,
Oct 1, 2021, 9:52:26 AM10/1/21
to ajitab...@gmail.com, MRST-users: The Matlab Reservoir Simulation Toolbox User Group

Thanks a lot for testing this!

 

I'll put this into MRST development sources right away to make sure we don't lose them and that they'll be included in future MRST releases.

Reply all
Reply to author
Forward
0 new messages