Hi Dani,
On 13.01.06, Dani Marti wrote:
> How could I plot two different histograms, using the class mentioned
> before, with two different, specified colors. Can I use histogramdata's
> arguments to specify the line attributes, or should I modify the class
> itself to achieve this?
>
> f.plot(histogramdata(list1)) # I would like this red
> f.plot(histogramdata(list2)) # ... and this blue.
Well, the point is, that here you always use the default style as
provided by the histogramdata class. Hence you basically have two
options to get what you want. You could specify the styles you want to
use in your specific use-case explicitly, i.e.
f.plot(histogramdata(list1),
[graph.style.histogram(lineattrs=[color.rgb.red]])
f.plot(histogramdata(list2),
[graph.style.histogram(lineattrs=[color.rgb.blue]])
Or you could change the default style in the histogramdata class. Just
change the defaultstyle definition in the beginning of the
histogramdata class:
defaultstyles = [graph.style.histogram(lineattrs=[color.palette.Rainbow])]
... should do it as well once and for all. Note that such a change can
also always be done by inheritance for classes (like for those cases,
where the classes are defined in PyX itself and in case you don't want
to change the PyX core on your local copy ... ;-)).
Have fun,
André
--
by _ _ _ Dr. André Wobst
/ \ \ / ) [EMAIL PROTECTED], http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user