Hello all,
I got two problems that I needed help with in regards to the scatter function provided by MATLAB.
Problem 1:
So, I'm trying to plot points on the vertices of my polygon. I want the colour of these points to be determined by the angle subtended at that vertex of the polygon. I used a colorbar and have the following code for the scatter function:
scatter(app.UIAxes, x_vals, y_vals, size_of_markers, angles_at_vertices, 'filled');
This works fine for all the polygons that have more than 3 vertices - but when it comes two triangles, since there are three angles within them MATLAB detects my variable, angles_at_vertices as an RGB triplet and gives me the following error:
Warning: Error updating Scatter.
Invalid RGB triplet. Specify a three-element vector of values between 0 and 1.
I was wondering whether there is anyway for me to fix this?
Problem 2:
This is not really much of a problem, but more of an annoyance. Essentially, after i use the scatter function to plot my points onto my polygon, the UIAxes that I'm using gets resized and zoomed in to fit my plots exactly onto the axes.
Here is an example:
This is the before and after:
I was wondering whether there is any way of preventing this resize/zoom effect from hapenning?
Thanks in advance!