bugGNU Octave - Bugs: bug #65687, [Qt Backend] LineWidth parameter...

 
 

bug #65687: [Qt Backend] LineWidth parameter ignored

Submitter:  None
Submitted:  Sun 05 May 2024 02:45:45 AM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  None Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 9.1.0
Operating System:  * Mac OS Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 15 May 2024 09:12:46 PM UTC, comment #10: 

I'm going to close this bug.  But, Octave Developers are thinking of re-coding the OpenGL pipeline currently used.  It is quite old, and updating it to use modern practices would be both faster and allow for use of shaders.

Rik <rik5>
Group administrator
Mon 06 May 2024 10:46:00 PM UTC, comment #9: 

thanks, in pdf it works indeed but not as visually appealing (the line is outside the borders) and as you mention a few widths are supported (maybe on my system up to 4?).
Although not perfect, I prepared a kind-of workaround.


graphics_toolkit('qt')
x = 0:0.1:10;
y = x;
plot(x, y, 'LineWidth', 0.3);
hold on
y = x + 0.5;
plot(x, y, 'LineWidth', 0.5);
y = x + 1;
plot(x, y, 'LineWidth', 0.7);
y = x + 1.5;
plot(x, y, 'LineWidth', 1.0);
y = x + 2.0;
plot(x, y, 'LineWidth', 2.0);
y = x + 2.5;
plot(x, y, 'LineWidth', 10);
y = x + 3;
plot(x, y, 'LineWidth', 20);
y = x + 3.5;
plot(x, y, 'Color', 'b', 'LineWidth', 4);
y = x + 3.55;
plot(x, y, 'Color', 'b', 'LineWidth', 4);
y = x + 3.6;
plot(x, y, 'Color', 'b', 'LineWidth', 4);
y = x + 3.65;
plot(x, y, 'Color', 'b', 'LineWidth', 4);
title('Test Plot');
xlabel('x');
ylabel('y = x');


Since using a shader representation (that would then allow any width and it the "modern" OpenGL implementation) is a significant major change, you can close the issue.
It would be nice to add a note in the documentation of this dependency /limitation on OpenGL for tick lines.

many thanks for the support.

best regards,
Marco


Anonymous
Mon 06 May 2024 03:22:01 PM UTC, comment #8: 

Linewidth is drawn by OpenGL routines and is dependent on your particular library.  However, in my experience it usually works at least up to linewidth 3.  Linewidths like 10, 20, 80 are unlikely to plot well.  Also, try "print plot.pdf" and check the resulting pdf file.  It can be the case that the onscreen OpenGL renderer does not work, but the OpenGL drawing routines do.

Rik <rik5>
Group administrator
Mon 06 May 2024 01:06:35 AM UTC, comment #7: 

I run a few test and it seems I can track it to here


opengl_renderer::set_linewidth (float w)
{
#if defined (HAVE_OPENGL)
  // Measure LineWidth in points.  See bug #53056.
  m_glfcns.glLineWidth (points_to_pixels (w) * m_devpixratio);


From OpenGL documentation

https://registry.khronos.org/OpenGL-Refpages/gl4/html/glLineWidth.xhtml

>  Only width 1 is guaranteed to be supported; others depend on the implementation.


expanding my previous test further.


graphics_toolkit('qt')
x = 0:0.1:10;
y = x;
plot(x, y, 'LineWidth', 0.3);
hold on
y = x + 0.5;
plot(x, y, 'LineWidth', 0.5);
y = x + 1;
plot(x, y, 'LineWidth', 0.7);
y = x + 1.5;
plot(x, y, 'LineWidth', 1.0);
y = x  + 2;
plot(x, y, 'LineWidth', 2.0);
y = x + 2.5;
plot(x, y, 'LineWidth', 10);
y = x + 3;
plot(x, y, 'LineWidth', 20);
y = x + 3.5;
plot(x, y, 'LineWidth', 80);
title('Test Plot');
xlabel('x');
ylabel('y = x');


As attached, it works fine for less than 1, then there is no further changes and the width remains the same.


Anonymous
Sun 05 May 2024 10:42:25 PM UTC, comment #6: 

I tried as suggested before launching

QT_OPENGL=software
echo $QT_OPENGL
software
octave -V

(same with QT_OPENGL=desktop)

no particular warnings or errors in the console but the width is still unchanged.

I also tried

set(gca, "linewidth", 12)

which if I understand correctly should set all lines width, it changes once for the axis only (not change the line itself), but does not appear to be dynamic nor to be 12 (just a bit bolder)

so set(gca, "linewidth", 12) or set(gca, "linewidth", 24) gives the same width - and never changes.

best regards,

Anonymous
Sun 05 May 2024 08:39:15 PM UTC, comment #5: 

Can you tell me what I have to do to try those commands?

Have they to be put into octave command line?
I tried that, but I think that wasn't correct.

>> QT_OPENGL=desktop
error: desktop function requires new experimental terminal widget
>> QT_OPENGL=software
error: 'software' undefined near line 1, column 11


masum
Sun 05 May 2024 08:14:30 PM UTC, comment #4: 

Try "QT_OPENGL=desktop" and or "QT_OPENGL=software" anyway.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 05 May 2024 07:53:16 PM UTC, comment #3: 

Sadly I do not know how to apply that test using "QT_OPENGL=desktop" I don't know where I have to put that command.

I have to correct my posting, I tested the code from the original submission and tested also "gnuplot toolkit" that error occurred then and also, when I used "qt toolkit" afterward


>> graphics_toolkit('gnuplot')

x = 0:0.1:10;

y = x.^2;

plot(x, y);

title('Test Plot');

xlabel('x');

ylabel('y = x^2');
warning: using the gnuplot graphics toolkit is discouraged

The gnuplot graphics toolkit is not actively maintained and has a number
of limitations that are unlikely to be fixed.  Communication with gnuplot
uses a one-directional pipe and limited information is passed back to the
Octave interpreter so most changes made interactively in the plot window
will not be reflected in the graphics properties managed by Octave.  For
example, if the plot window is closed with a mouse click, Octave will not
be notified and will not update its internal list of open figure windows.
The qt toolkit is recommended instead.
qt.qpa.fonts: Populating font family aliases took 59 ms. Replace uses of missing font family"Sans" with one that exists to avoid this cost.
>> qt.pointer.dispatch: skipping QEventPoint(id=1 ts=0 pos=0,0 scn=718.252,837.048 gbl=718.252,837.048 Released ellipse=(1x1 ∡ 0) vel=0,0 press=-718.252,-837.048 last=-718.252,-837.048 Δ 718.252,837.048) : no target window

>> graphics_toolkit('qt')

x = 0:0.1:10;

y = x.^2;

plot(x, y);

title('Test Plot');

xlabel('x');

ylabel('y = x^2');

>> qt.pointer.dispatch: skipping QEventPoint(id=1 ts=0 pos=0,0 scn=524.742,648.248 gbl=524.742,648.248 Released ellipse=(1x1 ∡ 0) vel=0,0 press=-524.742,-648.248 last=-524.742,-648.248 Δ 524.742,648.248) : no target window

>>


When I use a newly started window and directly use "qt toolkit" that error doesn't occur, but a fallback warning. But this warning is there since ever.

And in this case, also the linewidth issue is present for me


>> graphics_toolkit('qt')

x = 0:0.1:10;

y = x.^2;

plot(x, y,'linewidth', 100);

title('Test Plot');

xlabel('x');

ylabel('y = x^2');

>> FALLBACK (log once): Fallback to SW vertex for line stipple
FALLBACK (log once): Fallback to SW vertex processing, m_disable_code: 2000
FALLBACK (log once): Fallback to SW vertex processing in drawCore, m_disable_code: 2000


sorry for the initial confusion

masum
Sun 05 May 2024 07:12:09 PM UTC, comment #2: 


comment #1:

> For me, the Linewitdth works fine, but with the newest build of octave from 2 days ago and qt 6.7 the following happens as soon as I mouse over the figure

<...deleted...>

> >> qt.pointer.dispatch: skipping QEventPoint(id=1 ts=0 pos=0,0 scn=347.807,664.875 gbl=347.807,664.875 Released ellipse=(1x1 ∡ 0) vel=0,0 press=-347.807,-664.875 last=-347.807,-664.875 Δ 347.807,664.875) : no target window
>


Can you set "QT_OPENGL=desktop" and/or "QT_OPENGL=desktop" before starting octave and see if that helps?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sun 05 May 2024 06:55:44 PM UTC, comment #1: 

For me, the Linewitdth works fine, but with the newest build of octave from 2 days ago and qt 6.7 the following happens as soon as I mouse over the figure


>> graphics_toolkit('qt')

x = 0:0.1:10;

y = x.^2;

plot(x, y);

title('Test Plot');

xlabel('x');

ylabel('y = x^2');
>> qt.pointer.dispatch: skipping QEventPoint(id=1 ts=0 pos=0,0 scn=347.807,664.875 gbl=347.807,664.875 Released ellipse=(1x1 ∡ 0) vel=0,0 press=-347.807,-664.875 last=-347.807,-664.875 Δ 347.807,664.875) : no target window


masum
Sun 05 May 2024 02:45:45 AM UTC, original submission:  

-----------------------
%graphics_toolkit('gnuplot')
graphics_toolkit('qt')
x = 0:0.1:10;
y = x.^2;
plot(x, y, 'LineWidth', 10);
title('Test Plot');
xlabel('x');
ylabel('y = x^2');

-------------------------

Qt backend seems to ignore the parameter and always use the default width (tried 'linewidth' and values from 1 to 100 as test, no change)

changing to the deprecated gnuplot backend the difference is visible

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #56020:  qt_2.png added by None (76KiB - image/png)
file #56018:  qt.png added by None (77KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by masum (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-05-15 rik5 Open/ClosedOpen Closed
    2024-05-06 None Attached File- Added qt_2.png, #56020
    2024-05-06 None Attached File- Added qt.png, #56018

    Back to the top

    Powered by Savane 3.13-f762.
    Corresponding source code