Hi Andrew and Maurice
 
I agree that the recommendation is that cmap1 is used for e.g. colourscales of 
shade plots, and cmap0 be used for points/lines/text, but the manual seems to 
imply this is a recommendation and that whichever map you use to set the colour 
will be used. The psc driver follows the latter behaviour. You may even see it 
as advantage to be able to set cmap1 colour fror a fill, but then a cmap0 
colour for text.
 
The situation I was in was using plstring to plot points on an x, y scale but I 
wanted the colour of the points to vary with a third variable, z. Example 
psudocode is below.
 
//x, y, z 1d data
double x[20];
double y[20];
double z[20];
 
double maxz;//maximum value in the z array
char pointcharacter[2]; //character used as a datapoint on my plot
 
//some code to initialize my data
//some code to initialize cmap1 using a hls colour scale
 
for(int i=0; i<20; i++) 
{
    plcol1(z[i]/maxz);
    plstring(1,x+i,y+i,pointcharacter);
}
 
One alternative could be to introduce a function which returns the rgb/hls 
value of col1, allowing col0 to be set. However I think that given the 
wxWidgets drivers differ in behaviour from the psc driver (and I have a feeling 
the one of the three wxWidgets drivers differs from the others) means that this 
is a bug and all drivers should behave the same in this respect, whichever way 
is deamed correct.
 
Thanks for taking the time to consider this.
 
Phil
 

________________________________
  
------------------------------

Message: 2
Date: Mon, 16 Jan 2012 14:47:40 +0000
From: Andrew Ross <andrewr...@users.sourceforge.net>
Subject: Re: [Plplot-devel] [ plplot-Bugs-3474186 ] wxWidgets dc and
    gc    driver on uses cmap0 for text
To: Plplot-devel mailing list <plplot-devel@lists.sourceforge.net>
Message-ID: <20120116144740.GA25382@gandalf.rivendell>
Content-Type: text/plain; charset=us-ascii


Is this actually a bug? Example 12 uses plcol1 to set the colour for the
boxes in a box chart, then plots text. The text comes out in the same 
(cmap0) colour even though the boxes change colour. I've checked with 
xwin / psc / wxwidgets / qt and cairo drivers and all seem to do the 
same thing.

Phil, if you are on the list can you provide us with a short demonstration
to illustrate what you mean?

Andrew

On Sun, Jan 15, 2012 at 07:41:48AM -0800, SourceForge.net wrote:
> Bugs item #3474186, was opened at 2012-01-15 07:41
> Message generated for change (Tracker Item Submitted) made by philrosenberg
> You can respond by visiting: 
> https://sourceforge.net/tracker/?func=detail&atid=102915&aid=3474186&group_id=2915
> 
> Please note that this message will contain a full copy of the comment thread,
> including the initial issue submission, for this request,
> not just the latest update.
> Category: None
> Group: None
> Status: Open
> Resolution: None
> Priority: 5
> Private: No
> Submitted By: Phil Rosenberg (philrosenberg)
> Assigned to: Nobody/Anonymous (nobody)
> Summary: wxWidgets dc and gc driver on uses cmap0 for text
> 
> Initial Comment:
> When drawing text using the dc and gc wxWidgets driver it always uses cmap0 
> colours. Setting the foreground colour using cmap1 has no effect upon the 
> text colour. I think from looking at the code (but I have not checked) that 
> the agg wxWidgets text colour can be set by either cmap0 or cmap1. I've 
> checked the psc driver and this allows setting the colour using cmap1. This 
> behaviour is not documented in the manual as far as I can see.
> 
> This can be fixed by editing the wxPLDevDC::ProcessString function in 
> wxwidgets_dc.cpp and wxwidgets_gc.cpp - the appropriate lines are pretty 
> obvious.
> 
> I'm sorry I can't submit a patch but I only have access to a windows machine 
> so don't have access to diff, which I think is needed for creating patches
> 
> 
> ----------------------------------------------------------------------
> 
> You can respond by visiting: 
> https://sourceforge.net/tracker/?func=detail&atid=102915&aid=3474186&group_id=2915
> 
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Mar 27 - Feb 2
> Save $400 by Jan. 27
> Register now!
> http://p.sf.net/sfu/rsa-sfdev2dev2
> _______________________________________________
> Plplot-devel mailing list
> Plplot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/plplot-devel
> 


------------------------------

Message: 4
Date: Mon, 16 Jan 2012 11:02:43 -0700
From: Maurice LeBrun <m...@brownwolf.org>
Subject: Re: [Plplot-devel] [ plplot-Bugs-3474186 ] wxWidgets dc    and
    gc    driver on uses cmap0 for text
To: Andrew Ross <andrewr...@users.sourceforge.net>
Cc: Plplot-devel mailing list <plplot-devel@lists.sourceforge.net>
Message-ID: <20244.26179.997385.910...@gumby.brownwolf.org>
Content-Type: text/plain; charset=us-ascii

Not a bug at least according to original design.  cmap1 is intended for
representing "continuous" data variation through a mapping of value to color,
cmap0 for more fixed elements like labels and axes.  OTOH given a compelling
example of why/when/how you'd want to use cmap1 instead it might be worth
supporting that.

-- 
Maurice LeBrun

On Monday, January 16, 2012 at 14:47:40 (+0000) Andrew Ross writes:
> 
> Is this actually a bug? Example 12 uses plcol1 to set the colour for the
> boxes in a box chart, then plots text. The text comes out in the same 
> (cmap0) colour even though the boxes change colour. I've checked with 
> xwin / psc / wxwidgets / qt and cairo drivers and all seem to do the 
> same thing.
> 
> Phil, if you are on the list can you provide us with a short demonstration
> to illustrate what you mean?
> 
> Andrew
> 
> On Sun, Jan 15, 2012 at 07:41:48AM -0800, SourceForge.net wrote:
> > Bugs item #3474186, was opened at 2012-01-15 07:41
> > Message generated for change (Tracker Item Submitted) made by philrosenberg
> > You can respond by visiting: 
> > https://sourceforge.net/tracker/?func=detail&atid=102915&aid=3474186&group_id=2915
> > 
> > Please note that this message will contain a full copy of the comment 
> > thread,
> > including the initial issue submission, for this request,
> > not just the latest update.
> > Category: None
> > Group: None
> > Status: Open
> > Resolution: None
> > Priority: 5
> > Private: No
> > Submitted By: Phil Rosenberg (philrosenberg)
> > Assigned to: Nobody/Anonymous (nobody)
> > Summary: wxWidgets dc and gc driver on uses cmap0 for text
> > 
> > Initial Comment:
> > When drawing text using the dc and gc wxWidgets driver it always uses cmap0 
> > colours. Setting the foreground colour using cmap1 has no effect upon the 
> > text colour. I think from looking at the code (but I have not checked) that 
> > the agg wxWidgets text colour can be set by either cmap0 or cmap1. I've 
> > checked the psc driver and this allows setting the colour using cmap1. This 
> > behaviour is not documented in the manual as far as I can see.
> > 
> > This can be fixed by editing the wxPLDevDC::ProcessString function in 
> > wxwidgets_dc.cpp and wxwidgets_gc.cpp - the appropriate lines are pretty 
> > obvious.
> > 
> > I'm sorry I can't submit a patch but I only have access to a windows 
> > machine so don't have access to diff, which I think is needed for creating 
> > patches
> > 
> > 
> > ----------------------------------------------------------------------
> > 
> > You can respond by visiting: 
> > https://sourceforge.net/tracker/?func=detail&atid=102915&aid=3474186&group_id=2915
> > 
> > ------------------------------------------------------------------------------
> > RSA(R) Conference 2012
> > Mar 27 - Feb 2
> > Save $400 by Jan. 27
> > Register now!
> > http://p.sf.net/sfu/rsa-sfdev2dev2
> > _______________________________________________
> > Plplot-devel mailing list
> > Plplot-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/plplot-devel
> > 
> 
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Mar 27 - Feb 2
> Save $400 by Jan. 27
> Register now!
> http://p.sf.net/sfu/rsa-sfdev2dev2
> _______________________________________________
> Plplot-devel mailing list
> Plplot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/plplot-devel
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to