1 Attachment(s)
QwtPlotRenderer doesn't render QwtScaleWidget axis
Hi all,
I'd like to create a pdf document of my plot (QwtPlot)
QwtPlotRenderer* plotRender = new QwtPlotRenderer();
plotRender->setDiscardFlag(QwtPlotRenderer::DiscardBackground ,true);
plotRender->setDiscardFlag(QwtPlotRenderer::DiscardCanvasBack ground,true);
plotRender->setDiscardFlag(QwtPlotRenderer::DiscardLegend,fal se);
plotRender->setDiscardFlag(QwtPlotRenderer::DiscardTitle,fals e);
plotRender->setLayoutFlag(QwtPlotRenderer::FrameWithScales,tr ue);
plotRender->setLayoutFlag(QwtPlotRenderer::KeepFrames,true) ;
plotRender->setLayoutFlag(QwtPlotRenderer::KeepMargins,true );
plotRender->renderDocument(plot,"F:/pippo.pdf","pdf",QSizeF(100,150),150);
This code desn't render the axis of the plot!
the axis are defined in the following way:
axis y
// A color bar on the right axis
QwtScaleWidget colorAxis;
colorAxis = axisWidget(QwtPlot::yLeft);
colorAxis->setColorBarEnabled(true);
colorAxis->setColorMap( zInterval, new ColorMap());
colorAxis->setMinBorderDist(10,6);
enableAxis(QwtPlot::yLeft,true);
axis x
QwtScaleWidget *bottomAxis;
enableAxis(QwtPlot::xBottom,true);
bottomAxis = axisWidget(QwtPlot::xBottom);
QTime time;
setAxisScaleDraw(QwtPlot::xBottom, new TimeScaleDraw(time));
setAxisLabelAlignment(QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom);
this is the result:
Attachment 7426
can you help me?
thanks cla
Re: QwtPlotRenderer doesn't render QwtScaleWidget axis
why doesn't anybody reply to me ??
Is it a so simple query or is it impossible??
thanks cla
Re: QwtPlotRenderer doesn't render QwtScaleWidget axis
Compare your code with the spectrogram example - but at least QwtPlotRenderer::FrameWithScales doesn't make much sense in combination with a color bar.
Uwe
Re: QwtPlotRenderer doesn't render QwtScaleWidget axis
I Uwe,
thanks a lot for your reply ..
My code is based on the spectrogram example.. and about axis i don't find important differences...
I haven't any problem with axis and plot on screen, but only to print...
I tried whit a simple:
QwtPlotRenderer renderer;
renderer.renderDocument(this,"F:/pippo.pdf","pdf",QSizeF(300,250));
with default setting.. but the result is the same.
If you have some idea, please suggest me..
I hope to find the way to render my plot with axis as soon as, and I 'll write here the solution..
thanks
Claudia
I used QwtPlotRenderer::FrameWithScales only to try something because I don't understand :( ...
Re: QwtPlotRenderer doesn't render QwtScaleWidget axis
Code:
QwtPlotRenderer renderer;
renderer.
renderDocument(this,
"pippo.pdf",
"pdf",
QSizeF(300,
250));
Testing this code with the spectrogram example ( code in Plot::printPlot replaced ) on my linux box - Qt 4.8.0 + Qwt from 6.0 SVN branch - everything works like expected.
I'm afraid you have to post some compilable demo code demonstrating the problem.
Uwe
Re: QwtPlotRenderer doesn't render QwtScaleWidget axis
I Uwe..
Trying to resolve my problem, I rebuild qwt... and my application starts to crash..
Usually I don't off my pc.. I suspend it..
This mornig my windows has had several problems, so I have to restart it!
After all was ok!!!!!!! also the pdf with scalewidget .....
It's possibile??? I'm crazy???
I'm confused because I did not undestand what was the problem!!!
So, I thank you and I hope my next question will be better!