Werner
Werner

Reputation: 2557

Patch with transparency and timestamp indexes breaks figure

I am having trouble plotting a patch on a figure with transparency and timestamp index varying in datenum range of 735k, which is more or less the datenum you will acquire for the actual dates.

The following example illustrate my issue:

k=[735172.912437674 735172.941375799 0 7830];
figure;
axis(k);
p=patch([k(1) k(1) k(2) k(2)], [k(3) k(4) k(4) k(3)],[0 0 0 0],'r', 'FaceAlpha', 0.1);

Bug with patch

Are you able to reproduce this bug? Any suggestions? I've seen this other post and searched about it, but no clue. I wouldn't like to remove the minimum from my time stamps, I would have to adapt all the code just because of this x(

Upvotes: 2

Views: 162

Answers (1)

Werner
Werner

Reputation: 2557

I was learning about this other question and they led me to study a bit the new Handle Graphics that may finally appear this or next year (?) — looks like trying to discovering trends at financial business, guess when this will go out, if it will haha. It may be used by adding -hgVersion 2 option at your matlab launch. And by doing so, the resulting figure looks like this \o/:

HG2 somewhere far beyond the limits of HG1 would go

Great… but beware that there are some differences on the usage from the HG1 to the HG2 that may lead your code not to work (specially if you are using listeners) but if you want to explore this even more undocumented code add an if in your codes where it breaks:

if feature('UseHG2')
  % HG2 approach
else
  % HG1 approach
end

One good thing it's that at least we can get the meta.class from the handles, so we can explore them easier x) and the usage is quite more intuitive with the matlab oop development way.

Upvotes: 1

Related Questions