# Error with uq\_plot

**URL:** <https://uqworld.org/t/error-with-uq-plot/565>\
**Category:** Community Q&A and How To\
**Tags:** graphics, inversion\
**Created:** [April 14, 2020, 10:11am UTC](https://uqworld.org/t/error-with-uq-plot/565 "2020-04-14T10:11:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArjunC](https://uqworld.org/letter_avatar_proxy/v4/letter/a/4bbf92/32.png) [@ArjunC](https://uqworld.org/u/ArjunC)\
**Post date:** [April 14, 2020, 10:11am UTC](https://uqworld.org/t/error-with-uq-plot/565/1 "2020-04-14T10:11:38Z")

</div>

Hello,

I have recently attempted to use the Bayesian inference tool. To start, I simply ran the first example problem, i.e., uq\_Example\_Inversion\_01\_Beam. I get this error with uq\_display which is the same as [https://uqworld.org/t/error-with-uq-display/351](https://uqworld.org/t/error-with-uq-display/351). The solution in this post is to reinstall Matlab, which I do not want to do.

I ran another inference problem, this time, uq\_Example\_Inversion\_04\_PredPrey.m. The script breaks at uq\_display(myBayesianAnalysis, ‘trace’, 1) line. And, I get the following error,

Data must be a single matrix Y or a list of pairs X,Y.

Error in uq\_traceplot (line 125)  
uq\_plot(…

Error in uq\_AIES (line 208)  
plotHandle = uq\_traceplot(Sample(1:ii,plotParameters,:),…

Error in uq\_inversion (line 91)  
Results.LogLikeliEval] = uq\_AIES(…

Error in uq\_initialize\_uq\_inversion (line 708)  
uq\_runAnalysis(CurrentAnalysis);

Further digging into the problem, I realize there is some problem with uq\_plot because the following breaks too.

_clearvars_  
_rng(1,‘twister’)_  
_uqlab_  
_InputOpts.Marginals(1).Type = ‘Uniform’;_  
_InputOpts.Marginals(1).Parameters = [0 1];_  
_InputOpts.Marginals(2).Type = ‘Uniform’;_  
_InputOpts.Marginals(2).Parameters = [0 1];_  
_myInput = uq\_createInput(InputOpts);_  
_uq\_figure;_  
_ax=gca;_  
_X\_MC = uq\_getSample(80,‘MC’);_  
_uq\_plot(ax, X\_MC(:,1), X\_MC(:,2), ‘.’, ‘MarkerSize’, 10)_  
_xlabel(’$\mathrm{X\_1}$’, ‘Interpreter’,‘latex’)_  
_ylabel(’$\mathrm{X\_2}$’,‘Interpreter’,‘latex’)_

It seems like uq\_plot is not able to handle the axes handle. Please help me to rectify this.  
Moreover, the axis labels need the latex interpreter option, which I found missing in several codes (e.g., uq\_traceplot.m).

---

<div class="post-metadata">

**Author:** ![ArjunC](https://uqworld.org/letter_avatar_proxy/v4/letter/a/4bbf92/32.png) [@ArjunC](https://uqworld.org/u/ArjunC)\
**Post date:** [April 14, 2020, 12:49pm UTC](https://uqworld.org/t/error-with-uq-plot/565/3 "2020-04-14T12:49:26Z")

</div>

Apparently, adding the path of **UQLabCore\_Rel1.0.0\lib\uq\_graphics** folder to the script solved the problem. Although the entire _UQLabCore\_Rel1.0.0_ path with sub-folders are already in my Matlab search path.

---

<div class="post-metadata">

**Author:** ![damarginal](https://uqworld.org/user_avatar/uqworld.org/damarginal/32/73_2.png) [@damarginal](https://uqworld.org/u/damarginal)\
**Post date:** [April 14, 2020, 1:01pm UTC](https://uqworld.org/t/error-with-uq-plot/565/4 "2020-04-14T13:01:44Z")

</div>

Hi @ArjunC,

Welcome to UQWorld!

Great!

Because I could not reproduce the problem just like the previous post on the similar issue. There are differences in appearances between plots from older MATLAB (\< R2014b) and newer ones, but nothing that will break the code.

By the way, regarding your remark on the interpreter, because LaTeX interpreter is used across UQLab plotting functions, it is not put in the individual functions. Instead there’s a common formatting function that deals with this.

---

<div class="post-metadata">

**Author:** ![damarginal](https://uqworld.org/user_avatar/uqworld.org/damarginal/32/73_2.png) [@damarginal](https://uqworld.org/u/damarginal)\
**Post date:** [April 20, 2020, 8:53am UTC](https://uqworld.org/t/error-with-uq-plot/565/8 "2020-04-20T08:53:20Z")

</div>


