Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8046451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:47:24+00:00 2026-06-05T05:47:24+00:00

I am using the plotgauss2d function of BNT to visualize how the response of

  • 0

I am using the plotgauss2d function of BNT to visualize how the response of a 2D Gaussian node changes when evidence is observed elsewhere in the net.

eng = jtree_inf_engine(bnet);
evidence = cell(1, 2)
eng = enter_evidence(eng, evidence);
marginals = marginal_nodes(eng, 1); p_1 = marginals.T
marginals = marginal_nodes(eng, 2); p_2 = marginals.T
marginals
clf; plotgauss2d(marginals.mu, marginals.Sigma);
hold all;
evidence{1} = 1;
marginals = marginal_nodes(enter_evidence(eng, evidence), 2);
p = plotgauss2d(marginals.mu, marginals.Sigma);
set(p, 'Color', 'green');
evidence{1} = 2;
marginals = marginal_nodes(enter_evidence(eng, evidence), 2);
p = plotgauss2d(marginals.mu, marginals.Sigma);
set(p, 'Color', 'red');
legend({'Unknown', 'Class 1', 'Class 2'});
hold off;

enter image description here

As you can see, the legend is not picking up the changed plot colors I had to manually set. (Sadly plotgauss2d does not cycle through colors automatically as you might wish.)

Is there a way to set the line colors used in the legend too?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:47:26+00:00Added an answer on June 5, 2026 at 5:47 am

    The PLOTGAUSS2D function returns a vector of three handles corresponding to minor axis, major axis, and ellipse respectively. So here is an example how to store the handles and call LEGEND at the end:

    figure, hold on
    h = zeros(3,3);
    h(:,1) = plotgauss2d(rand(2,1), [1 0.5; 0.5 2]);
    h(:,2) = plotgauss2d(rand(2,1), [2 -0.5; -0.5 1]);
    h(:,3) = plotgauss2d(rand(2,1), [1 0; 0 2]);
    hold off
    set(h(:,1), 'Color','r')
    set(h(:,2), 'Color','g')
    set(h(:,3), 'Color','c')
    legend(h(1,:), {'1','2','3'})
    

    screenshot

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Delphi 2010. I am looking for (possibly) a function or procedure which can
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using WebViewBrush I can render web page content (it's screen shot) to e.g. Rectangle
Using Jenkins or Hudson I would like to create a pipeline of builds with
Using PyGtk's IconView, I can set the icons to be reorderable by calling gtk.IconView.set_reorderable(True)
Using Java,I have to fetch multiple sets of values from an XML file to
Using MVVM. I have a DataTemplate which I am using to display an expander

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.