zackxconti / bnmetamodel_gh

Repo for bnmetamodel lib version for Lab Mouse Grasshopper plug-in.
1 stars 2 forks source link

Fix xticks in rendering posteriors #38

Open kallewesterling opened 11 months ago

kallewesterling commented 11 months ago

See BayesianNetwork.plotPDs:

            if 'posteriorPD' in kwargs:
                if len(kwargs['posteriorPD'][varName]) > 1:
                    if varName in evidenceVars:
                        ax.bar(xticksv, kwargs['posteriorPD'][varName], align='center', width=binwidths, color='green', alpha=0.2, linewidth=0.2)
                    else:
                        ax.bar(xticksv, kwargs['posteriorPD'][varName], align='center', width=binwidths, color='red', alpha=0.2, linewidth=0.2)

            # TODO:  .... not plotting all
            # plt.xlim(edge[0], max(edge))
            plt.xticks([round(e, 4) for e in edge], rotation='vertical')
            plt.ylim(0, 1)
            # plt.show()