Matlab 2018b, ginput(), and tabbed figures

9 views (last 30 days)
Justin Brubaker
Justin Brubaker on 23 Oct 2018
Commented: Jenny Khuon on 11 Jun 2020
I have a code set that works in 2017a but does not work in 2018b. I have traced the issue down a problem within the ginput() function when using a tabbed figure (my code works if I eliminate the tabbed figure). The error message that I get is:
Dot indexing is not supported for variables of this type.
Error in ginput>setupFcn (line 221) initialState.toolbarVisible{1} = tb.Visible;
Error in ginput (line 60) initialState = setupFcn(fig);
Here are two simplified versions of the code:
1. Version that doesn't work in 2018b but does in 2017a
a = 1:100; f = figure(100); clf
tabgp = uitabgroup(f, 'Position', [0.05 0.05 0.90 0.90]); tabgp.Units = 'pixels';
tab1 = uitab(tabgp, 'Title', 'Tab 1'); tab1.BackgroundColor = [1.0 1.0 1.0]; tab1.ForegroundColor = [0.3 0.3 0.3];
tab2 = uitab(tabgp, 'Title', 'Tab 2'); tab2.BackgroundColor = [1.0 1.0 1.0]; tab2.ForegroundColor = [0.3 0.3 0.3];
axes('parent', tab1)
subplot(5, 1, 1) plot(a)
subplot(5, 1, 2) plot(a)
[x,y] = ginput()
2. Version that works in both 2018b and 2017a
a = 1:100; f = figure(100); clf
subplot(5, 1, 1) plot(a)
subplot(5, 1, 2) plot(a)
[x,y] = ginput()
Has anyone encountered this? Any fixes?
  2 Comments
Dan Hensley
Dan Hensley on 5 Dec 2018
I ran into this with an axis whose parent is a uipanel and not the base figure. I don't have any workaround. I submitted a bug report to Mathworks, as this has worked for many, many years. Hopefully they will have a workaround.
Here's a simple way to reproduce this bug:
hf = figure;
hp = uipanel;
plot(1:10,rand(1:10));
set(gca,'Parent',hp)
[x,y] = ginput(1)
Dan Hensley
Dan Hensley on 5 Dec 2018
I just discovered that this bug has been fixed in R2018b update 1. The bug number is 1873881.

Sign in to comment.

Answers (1)

Samuel Bignardi
Samuel Bignardi on 12 Nov 2018
Edited: Samuel Bignardi on 12 Nov 2018
I encounter the same problem. I got it work by excluding few of the original lines (SEE THE ATTACHMENT)
It is just a temporary workaround.
My best,
Samuel Bignardi
  2 Comments
Jenny Khuon
Jenny Khuon on 11 Jun 2020
I got it work already. It is about case letter, lower and upper case issue.
I kept reading doccument and googling, and I found out that it works on upper case letter in 2017a, but not 2018b. 2018b requires lower case.
I have tested on 2017a and 2018b by using lower case letter, and it works.
Thank you all.
Jenny Khuon
Jenny Khuon on 11 Jun 2020
I could not share program and data due to my job type. I hope you got the picture.

Sign in to comment.

Categories

Find more on Data Exploration in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!