JKQtPlotter
JKQtPlotter copied to clipboard
Symbol tickness differs in actual plot and legend
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.
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
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:
- If you don't need a parametrization of the symbols, you can simply use JKQTPXYLineGraph, with setDrawLines(false). The latter one is way faster!
- 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!
- ... 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!
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:
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.
fixed via https://github.com/jkriege2/JKQtPlotter/commit/889f95e7af05d4c0fd2bea23109cf0e3bfe7c43a
Perfect. I will try it out also this one.
Thanks!