LineWidth control in x and y (width and height)

I would like to fix line thickness to just be applied in the y direction as not to obscure the true x value of the data I am presenting. Below is simplified code that illustrates the issue.
x = [-10 0];
y = [0 0];
plot(x, y,'Color', 'b','LineWidth',100)
set(gca,'layer','top')
hold on
plot([0,5], [0 0],'Color', 'r' ,'LineWidth',20)
It looks like with these high values of LineWidth the true x values are padded where I would like it to stop immediately at the given values. I am using version 2014b.

7 Commenti

I do not observe any x padding? Which MATLAB are you using and which operating system? Please attach an image of what you observe.
C K
C K il 5 Nov 2016
Modificato: C K il 5 Nov 2016
Walter,
I am using a Linux box with RH6 on 2014b. With 2011b on the same machine I get the result you show. 2014b produces the following result
Odd.
What does
opengl info
return for whether it is using hardware or software rendering? Are you using a vendor graphics driver or are you using Mesa?
I do not have Linux running directly on hardware here; I have virtual machines that I fire up at need for testing. Unfortunately those virtual machines cannot access the graphics hardware directly and getting the layers right is.. tricky. The best I have been able to do so far is Unbuntu 14.04 with software openGL 1.2, a combination which does not show the problem with MATLAB R2016b. I went looking for RH6 but it appears to be a commercial product. I will try a couple of other combinations.
C K
C K il 5 Nov 2016
Modificato: C K il 5 Nov 2016
It is using software rendering with Mesa. When I purposefully turn off software opengl rendering the issue remains.
>> opengl info
Version: '2.1 Mesa 7.2'
Vendor: 'Brian Paul'
Renderer: 'Mesa X11'
MaxTextureSize: 2048
Visual: 'Visual 0x22, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buf...'
Software: 'true'
SupportsGraphicsSmoothing: 0
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 0
Extensions: {114x1 cell}
MaxFrameBufferSize: 4096
Unfortunately Debian 8 and Centos 7 do not get me anywhere in testing; MATLAB crashes due to a missing symbol (it appears it takes a lot of effort to define the symbol; I worked on it for an hour or more the other day and just ended up having to load in more and more and deal with incompatible distribution mechanisms... bleh.)
I will try putting R2014b on my Ubuntu 14.04 VM.
Walter Roberson
Walter Roberson il 5 Nov 2016
Modificato: Walter Roberson il 5 Nov 2016
I confirm the behavior on R2014b on Ubuntu 14.04 with software opengl.
I have submitted a bug report about this, referencing your Question. Although it appears to have been fixed in later releases, there is no public bug report about it, so I do not know if there is any known work-around.
Walter,
Thank you for your help on this and narrowing down the root of the problem. I will see about getting a more recent version if possible but that is not always easy. Thanks again!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Graphics Performance in Centro assistenza e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by