Results 1 to 4 of 4

Thread: XY plots with color squares -- i.e. shmoo plots

  1. #1
    Join Date
    Dec 2011
    Posts
    60
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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:

    image5224074054341222068.jpg

    sram4.jpg

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: XY plots with color squares -- i.e. shmoo plots

    Quote Originally Posted by alketi View Post
    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

  3. #3
    Join Date
    Dec 2011
    Posts
    60
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: XY plots with color squares -- i.e. shmoo plots

    Quote Originally Posted by Uwe View Post
    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.

    image5224074054341222068.jpg

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: XY plots with color squares -- i.e. shmoo plots

    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.

    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

Similar Threads

  1. Aligning 2 plots
    By jerrychan in forum Qwt
    Replies: 2
    Last Post: 25th February 2013, 09:12
  2. multi plots
    By 21did21 in forum Qwt
    Replies: 7
    Last Post: 24th May 2011, 02:11
  3. qwt plots & inheritance
    By fatecasino in forum Qwt
    Replies: 1
    Last Post: 14th December 2010, 15:35
  4. Plots and Layouts
    By Ozzy in forum Qwt
    Replies: 5
    Last Post: 17th November 2009, 10:00
  5. Reg multiple plots in Qwt
    By Tavit in forum Qwt
    Replies: 4
    Last Post: 23rd June 2008, 14:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.