Tuesday, December 13, 2011

Set marker edge width in Matlab figures

A couple of days ago, I plotted about twenty figures and was trying to set the markers with thicker edge. This would be very easy if it was in Excel: just change the 'Marker Line Style' in the 'Format data series' tab. However, it was kind difficult to do in Matlab. At least I didn't get a good solution from the google results on that day.

Today I happened to find the solution when I was playing with Matalb just for fun. The fact is that the 'Marker Edge Width' is actually defined by the 'LineWidth', even when the plot does not use a line to connect the markers..

t=[1:5];
plot(t,sin(t), 's', 'Markersize', 20,'LineWidth', 5)  



7 comments:

  1. Thank you... this saved me quite a bit of effort

    ReplyDelete
  2. You are very welcome, Swagatika. Recently I realized that R is more friendly for data visualization. You might want to give it a try too. :)

    ReplyDelete
  3. Can you change the marker edge width independently of the line width? I have a graph with both lines and markers. Marker size doesn't do what I want as I want an 'x' for the marker. Thanks for any input.

    ReplyDelete
  4. I think you can achieve that by overlay two plots like this:

    t=[1:5];
    plot(t,sin(t), 'x', 'Markersize', 20,'LineWidth', 5)
    hold on
    plot(t,sin(t), '-','LineWidth', 1)

    Let me know if this method works for you or not :)

    ReplyDelete
  5. Hi, but if you have both a line with markers, and you just want to change the markers width its impossible? matlab changes both?

    ReplyDelete
  6. Yes that works perfect, thank you

    ReplyDelete
  7. Setting the marker edge width in MATLAB figures is a crucial aspect of customizing plots. How Laptop Use It allows for controlling the thickness of the lines around data points, enhancing visual clarity.

    ReplyDelete

Any comments?

my-alpine and docker-compose.yml

 ``` version: '1' services:     man:       build: .       image: my-alpine:latest   ```  Dockerfile: ``` FROM alpine:latest ENV PYTH...