2 Attachment(s)
XY plots with color squares -- i.e. shmoo plots
What's the best way to represent XY plots with color squares, as typified by "shmoo plots"?
i.e. QColor shmoo[x][y];
where: X + Y represent the coordinates of a square, and a color per square can be assigned
These don't appear to be a native plot type -- so how much functionality can be gained by overloading current functionality?
Constraints:
- Axis numbers must be placed in-between grid lines.
- Grid lines bound each square.
- Each square may be a different color.
Examples:
Attachment 8891
Attachment 8892
Re: XY plots with color squares -- i.e. shmoo plots
Quote:
Originally Posted by
alketi
What's the best way to represent XY plots with color squares, as typified by "shmoo plots"?
There are plot and paint device coordinates - how are your squares related to these coordinate systems ?
Uwe
1 Attachment(s)
Re: XY plots with color squares -- i.e. shmoo plots
Quote:
Originally Posted by
Uwe
There are plot and paint device coordinates - how are your squares related to these coordinate systems ?
So, in the attached image the relationship would be:
PLOT COORDINATES
x=10
y=2.5
DATA COORDINATES
x=0
y=0
The squares could be just a simple 2D array of color, as in:
QColor shmoo[10][10];
shmoo [0][0] = QColor("red");
But, they could also be represented in another way, if that's easier.
My requirements are
1. Create a plot that looks like the attached
2. Allow the user to click on a specific square and, in plot coordinates, re-measure that point. So, in the example below, clicking anywhere inside the lower-left point would tell me to re-measure Freq(x)=10MHz, Voltage(y)=2.5V.
What is the best way to draw color squares in Qwt that accomplishes these two goals?
Thank you for your guidance Uwe. :)
Attachment 8894
Re: XY plots with color squares -- i.e. shmoo plots
Quote:
The squares could be just a simple 2D array of color, ...
This can be done with a QwtPlotSpectrogram.
QwtMatrixRasterData in NearestNeighbur mode is close to what you want to do - see the rasterview example.
Quote:
Allow the user to click on a specific square and, in plot coordinates, re-measure that point.
Using QwtPlotPicker you have the plot coordinates of each click.
Uwe