Re: Draw text on top of both canvas and plot background?
Brought to you by:
rathmann
|
From: Elvis S. <elv...@or...> - 2019-03-12 07:50:54
|
Hi Uwe, Den tis 12 mars 2019 07:03Uwe Rathmann <Uwe...@ti...> skrev: > > I'd like to draw some text (the plot unit) right below the top X axis. > > The problem is that the place where I want to draw it straddles both the > > canvas and the plot background. > > Where exactly do you want to draw the extra text: > > - between tick labels and ticks > - between the backbone of the scale and the canvas border > - inside the canvas > - ... > Sorry if I wasn't clear, maybe the images I sent didn't show up since they were inline in the mail. I'm sending as regular attachments now. The desired_result.png image shows where I want to paint the text "g/t". I added the text with an image editor. It's right below the top axis, right aligned with its max label. The problem is that at that spot, the text will span both the canvas and the plot background. I tried painting the text in the paintEvent of my QwtPlot subclass (as shown in the earlier snippet), thinking I could paint on top of everything in the plot there. But the problem is that the canvas will paint over my text. See the result in overpainted.png. Hope that makes it more clear. Cheers, Elvis > Uwe > > > _______________________________________________ > qwt-interest mailing list > qwt...@li... > https://lists.sourceforge.net/lists/listinfo/qwt-interest > |