JKQtPlotter icon indicating copy to clipboard operation
JKQtPlotter copied to clipboard

Symbol tickness differs in actual plot and legend

Open sim186 opened this issue 2 years ago • 1 comments

Hi,

I just notices that the tickness of the symbol into the label is less ticker than the one in the actual plot. Is there a way to change it? I cannot find a function to interact with it. image

sim186 avatar Jun 29 '22 09:06 sim186

Hi!

thanks for reporting ... I'll look into it ... I'm not yet decided whether to treat this as a bug or a feature ... I'll let you know!

Best, JAN

jkriege2 avatar Jul 01 '22 17:07 jkriege2

OK ... I had time to look into this now ... I pressume you're using JKQTPXYParametrizedScatterGraph for you scatter-plot ... So this is what I have to say:

  1. If you don't need a parametrization of the symbols, you can simply use JKQTPXYLineGraph, with setDrawLines(false). The latter one is way faster!
  2. yes there is some scaling for drawing the symbols in the legend-keys, so if they are way too thick, the line-width is scaled, so they fit in the available space .... If they fit,no scaling is applied!
  3. ... BUT: there was a bug in the scaling in JKQTPXYParametrizedScatterGraph, but not in JKQTPXYLineGraph, which I will fix shortly!

I'll let you know when the problem is solved!

jkriege2 avatar Aug 25 '22 10:08 jkriege2

Now the scaling of symbol-sizes and line-widths in the key is controlled centrally by a few functions. The symbol thickness is used as in the plot, as long as it is <0.3min(rect.width,rect.height), the symbols have to be smaller than 0.9min(rect.width,rect.height) and the line-width has to be <0.4*min(...).

Here are two examples: scatter_error paramscatterplot

The fixes are implemented here:

  • JKQTPGraphSymbolStyleMixin::getKeySymbolLineWidthPx()
  • JKQTPGraphSymbolStyleMixin::getKeySymbolSizePx()
  • JKQTPGraphLineStyleMixin::getKeyLinePen()

Hope that solves your problem.

BTW: I also added a JKQTPXYScatterGraph, which is simpler than JKQTPXYLineGraph and JKQTPXYParametrizedScatterGraph ... if that is of interest for you.

jkriege2 avatar Aug 30 '22 07:08 jkriege2

fixed via https://github.com/jkriege2/JKQtPlotter/commit/889f95e7af05d4c0fd2bea23109cf0e3bfe7c43a

jkriege2 avatar Aug 30 '22 07:08 jkriege2

Perfect. I will try it out also this one.

Thanks!

sim186 avatar Sep 04 '22 13:09 sim186