but the linewidth propery ends up applying to both lines. Do I have to use two plot functions with a hold on command to have line1 a different width than line2? Thanks.
Just FYI, there is an "official" syntax for setting a property to different values on different objects. However, it's really ugly, and doesn't work everywhere. For example, I don't think that the plot function accepts this form.
It looks like this:
h = plot(x1,y1,x2,y2);
set(h,{'LineWidth'},{5;10})
The property name and property value need to each be a cell array, and the shape of the value cell array has to match the shape of the handle cell array.
That said, you're really better off with 2 calls to set in this case.
Line width, specified as a positive value in points, where 1 point = 1/72 of an inch. If the line has markers, then the line width also affects the marker edges.
The line width cannot be thinner than the width of a pixel. If you set the line width to a value that is less than the width of a pixel on your system, the line displays as one pixel wide.
Melden Sie sich an, um diese Frage zu beantworten.
Siehe auch
Kategorien
MATLABGraphicsFormatting and Annotation
Mehr zu Formatting and Annotation finden Sie in Help Center und File Exchange
Tags
plot linewidth
cheat sheets
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Es ist ein Fehler aufgetreten
Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Laden Sie die Seite neu, um sie im aktualisierten Zustand anzuzeigen.
Translated by
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
You can set the default MATLAB linewidth property by setting the 'DefaultLineLineWidth' property of the root graphics object. When new lines are created, they will inherit this property from the root object.
By default, the line width size is '1' in Matlab. Sometimes in complex figures or diagrams output gets disturbed or vanish, in such cases line width plays an important role. This command is represented as 'LineWidth'.
Modify Line Width, Marker Fill, and Marker Outline
For example, Line objects have a LineWidth property for controlling the line's thickness. To create a thicker line, you can specify the LineWidth as a name-value argument when you call the plot function. In this case, set the LineWidth to 3 .
To change the size manually, click the chart, and then drag the sizing handles to the size that you want. To use specific height and width measurements, on the Format tab, in the Size group, enter the size in the Height and Width box. . Then in the Scale Height and Scale Width boxes, enter the numbers that you want.
To adjust the size of this canvas, you can use the figure() function, which allows you to specify the width and height of the figure in inches. In the above code, figsize=(10, 5) sets the size of the plot to 10 inches wide and 5 inches tall.
To change the size of the plotting area, specify this property as a vector of the form [left bottom width height] . Use this function to query the plotting area, which is typically bounded by the plot box.
Adjust the R line thickness by specifying the options lwd (base plot) and size (ggplot2). Change manually the appearance (linetype, color and size) of ggplot lines by using, respectively, the function scale_linetype_manual(), scale_color_manual() and scale_size_manual().
You can also change the line width by passing a linewidth parameter to the plt.plot() function. The linewidth parameter takes a floating-point value representing the line's width.
Introduction: My name is Dan Stracke, I am a homely, gleaming, glamorous, inquisitive, homely, gorgeous, light person who loves writing and wants to share my knowledge and understanding with you.
We notice you're using an ad blocker
Without advertising income, we can't keep making this site awesome for you.