Plotting Transparent Polyhedra

162 views
Skip to first unread message

XB G

unread,
Sep 22, 2019, 10:51:55 PM9/22/19
to YALMIP
Hi Johan,
I recently found that YALMIP+MPT is very convenient for plotting polyhedra. Currently I mainly refer to this page: https://yalmip.github.io/example/polytopicgeometry/
I'm wondering if there is a way to make the polyhedra transparent (like the `FaceAlpha` option in Matlab)? Also is it possible to change the facet color (using RGB values)?

Thanks
XB

XB G

unread,
Sep 23, 2019, 12:54:42 AM9/23/19
to YALMIP
Making the plot transparent just needs to add `alpha(.5)` after plotting, an example

x = sdpvar(3,1);
plot( polytope([1 <= x <= 2]) )
alpha(0.1)

Johan Löfberg

unread,
Sep 23, 2019, 1:35:45 AM9/23/19
to YALMIP
the only outside controls are the color argument (third input) and the plot.shade option

Johan Löfberg

unread,
Sep 23, 2019, 1:40:24 AM9/23/19
to YALMIP
oops, there appears to be more

>> ops.plot

ans = 

  struct with fields:

    edgecolor: 'k'
    wirestyle: '-'
    wirecolor: 'k'
    linewidth: 0.5000
        shade: 1
      waitbar: 1



Reply all
Reply to author
Forward
0 new messages