473,703 Members | 3,032 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Variable size plot symbols, variable hue plot colors in Python (MatPlotLib) ?

Using MatPlotLib plot function, is there a way to get variable size
plot symbols? For example, using symbol strings like 'o' (circle), 's'
(square), 'x' (cross), etc., is there a way to specify other plot
symbols such a small circle, Medium square, LARGE cross, etc.?

Similarly, using the MatPlotLib plot function, is there a way to get
variable hue (RGB-specified) plot colors? For example, using symbol
strings like 'b' (blue), 'g' (green), 'red' (red), etc., is there a way
to specify other colors such as light blue, dark green, pink, etc.?

Or perhaps is there some other Python MatPlotLib or other Python module
functions that allow variable size plot symbols and variable hue plot
colors in Python ?

Thank you for your suggestions.

Jul 18 '05 #1
1 22895
>>>>> "Colombes" == Colombes <Dr********@yah oo.com> writes:

Colombes> Using MatPlotLib plot function, is there a way to get
Colombes> variable size plot symbols? For example, using symbol
Colombes> strings like 'o' (circle), 's' (square), 'x' (cross),
Colombes> etc., is there a way to specify other plot symbols such
Colombes> a small circle, Medium square, LARGE cross, etc.?

plot(x, y, 'o', markersize=10) # big
plot(x, y, 'o', markersize=20) # bigger

Colombes> Similarly, using the MatPlotLib plot function, is there
Colombes> a way to get variable hue (RGB-specified) plot colors?
Colombes> For example, using symbol strings like 'b' (blue), 'g'
Colombes> (green), 'red' (red), etc., is there a way to specify
Colombes> other colors such as light blue, dark green, pink, etc.?

All legal html color names are supported
plot(x, y, 'o', markersize=10, markerfacecolor ='green', markeredgecolor ='red')
Eg

lightblue : #ADD8E6
lightcoral : #F08080
lightcyan : #E0FFFF
lightgoldenrody ellow : #FAFAD2
lightgreen : #90EE90
lightgrey : #D3D3D3
lightpink : #FFB6C1
lightsalmon : #FFA07A
lightseagreen : #20B2AA
lightskyblue : #87CEFA
lightslategray : #778899
lightsteelblue : #B0C4DE
lightyellow : #FFFFE0
# or use aliases for less typing plot(x, y, 'o', ms=10, mfc='green', mec='red')
# or rgba or hex plot(x, y, 'o', ms=10, mfc='#008000, mec=(1,0,0,1) )

Colombes> Or perhaps is there some other Python MatPlotLib or
Colombes> other Python module functions that allow variable size
Colombes> plot symbols and variable hue plot colors in Python ?

The scatter command supports markers with varying sizes and colors.
screenshot with example code at
http://matplotlib.sourceforge.net/sc...#scatter_demo2 .
Docs at
http://matplotlib.sourceforge.net/ma....html#-scatter.

You might want to check out the tutorial and/or the user's guide.
Most of these issues are touched on there.

JDH
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4975
by: Dr. Colombes | last post by:
MatPlotLib question: How to get more different size plot symbols in the plot function ? Is there a way to get different size squares (or circles or triangles, etc.) ? For example, in a two dimensional plot of heights and weights of individuals, is there a way to represent also the age of the individual by the size of the plot symbol ?
6
3167
by: Carl-Olof Almbladh | last post by:
Already in the 1st edition of the "White book", Kerigham and Ritchie states the "C is a general purpose language". However, without what is usually called "assumed size arrays" and built-in complex, C is not entirely suitable for numerical work. In particular, in order to have functions which can manipulate matrices whose dimensions are not determined at compile time one needs pointers of the form, say, double (*a) where n is not a...
8
3508
by: chellappa | last post by:
hi Everybody ! decalaring variable in a.h and using that vaaariable in a1.c and inalization is in main.c it is possible .........pleaase correct that error is it Possible? i am trying it gives error! In file included from main.c:2: a1.c:3: error: initializer element is not constant
4
9527
by: nelsonchang | last post by:
Dear all, I wrote the VB code in a "button press event" as below in which is retrieve data from SQL server and insert the data into Excel. After that, I would call Excel "subtotal" API to build a subtotal figures. For first time, it is working fine. But in the second time, I try to execute the event again. Whenever it runs the command "Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(3)", it always raises the error "Err...
17
3012
by: yinglcs | last post by:
Hi, In STL, can I create a variable size but non-growable array? In Java, I can do this: int void f (int size) { int array = new int; // do something with array return array;
7
1849
by: serrand | last post by:
Hello all, i wonder if we can know the size of a variable from a pointer : static void *my_free_hook (void *ptr, const void *caller) { size_t sz; /* bla bla bla */ /* HOW CAN I DETERMINE SIZE OF *ptr ? */ printf ("size of freed memory : %u", sz);
1
2057
by: Abdul Samad | last post by:
Assalam mu Alikum, i understand the size of structure with no data types is zero. but why the size of structure variable is 1 Byte when the size of that structure is zeor? for example struct student{ } st; here structure student has zero size but why the size of st is not zero? why it is one?
0
377
by: David C | last post by:
I am getting this error in the Databound event of a GridView and I am having a difficult time debugging. I do not get the error on every record that I edit in the GridView. The error is occurring on the lines that start with varCtl. (for example varCtl.CssClass = "Hide"). The other thing that is strange is that it occurs when I click the Edit button on the GridView and yet the error is pointing to a line in the code that only gets...
0
1421
by: Paul Morriss | last post by:
I get this error from an application: ************** Exception Text ************** System.NullReferenceException: Object variable or With block variable not set. at Microsoft.VisualBasic.CompilerServices.Symbols.Container..ctor(Object Instance) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object Arguments, String ArgumentNames, Type TypeArguments, Boolean CopyBack) ...
0
8669
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9251
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8963
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5922
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3125
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2453
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2069
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.