Discussion:
Fine control of Marker Color
(too old to reply)
pem
2009-06-04 13:06:56 UTC
Permalink
Dear all,

From the manual I learned that Marker has 'EdgeColor' and 'FaceColor'. So I
write my script as fellow:


plot(A(:,2),A(:,4),'x','MarkerSize',10,'MarkerFaceColor','black','MarkerEdgeColor','red')
plot(A(:,2),A(:,5),'o','MarkerSize',10,'MarkerFaceColor','green','MarkerEdgeColor','black')
plot(A(:,2),A(:,6),'^','MarkerSize',10,'MarkerFaceColor','red','MarkerEdgeColor','black')
plot(A(:,2),A(:,7),'s','MarkerSize',10,'MarkerFaceColor','green','MarkerEdgeColor','black')
plot(A(:,2),A(:,8),'+','MarkerSize',10,'MarkerFaceColor','yellow','MarkerEdgeColor','black')
plot(A(:,2),A(:,9),'d','MarkerSize',10,'MarkerFaceColor','black','MarkerEdgeColor','black')

It runs with warning or error. But there's only blue in the resulted figure.
i.e., 'MarkerFaceColor' and 'MarkerEdgeColor' takes no effect here.

What's the right track to do this? Any advice is appreciated.


pem
2009-06-04
d***@free.fr
2009-06-04 21:05:50 UTC
Permalink
Post by pem
Dear all,
From the manual I learned that Marker has 'EdgeColor' and 'FaceColor'. So I
plot(A(:,2),A(:,4),'x','MarkerSize',10,'MarkerFaceColor','black','MarkerEdgeColor','red')
plot(A(:,2),A(:,5),'o','MarkerSize',10,'MarkerFaceColor','green','MarkerEdgeColor','black')
plot(A(:,2),A(:,6),'^','MarkerSize',10,'MarkerFaceColor','red','MarkerEdgeColor','black')
plot(A(:,2),A(:,7),'s','MarkerSize',10,'MarkerFaceColor','green','MarkerEdgeColor','black')
plot(A(:,2),A(:,8),'+','MarkerSize',10,'MarkerFaceColor','yellow','MarkerEdgeColor','black')
plot(A(:,2),A(:,9),'d','MarkerSize',10,'MarkerFaceColor','black','MarkerEdgeColor','black')
It runs with warning or error. But there's only blue in the resulted figure.
i.e., 'MarkerFaceColor' and 'MarkerEdgeColor' takes no effect here.
What's the right track to do this? Any advice is appreciated.
pem
2009-06-04
Octave can't handle the MarkerFaceColor property with the gnuplot
backend as gnuplot itself doesn't color the faces of the markers...
I'd expect that the 'MarkerEdgeColor' property should do something but
clearly doesn't... The 'Color' property changes both the line and
marker colors however.. I'm curious what Matlab does for the above
case..

D.
pem
2009-06-05 01:15:24 UTC
Permalink
Thank you for your reply.
Those codes works well in matlab, shows a thin ring of 'MarkerEdgeColor' and
the marker is filled with 'MarkerFaceColor'. In fact, I am trying to
transplant
them to Octave, but find there are no counterparts in Octave to reproduce
this effect.

pem
Post by d***@free.fr
Octave can't handle the MarkerFaceColor property with the gnuplot
backend as gnuplot itself doesn't color the faces of the markers...
I'd expect that the 'MarkerEdgeColor' property should do something but
clearly doesn't... The 'Color' property changes both the line and
marker colors however.. I'm curious what Matlab does for the above
case..
D.
pem
2009-06-05 12:18:35 UTC
Permalink
Hi all,

After a brief browsing of the manual of matplotlib,
I could manage to do this with it now, a bit lengthy though.

I am still seeking for an octave solution.

pem
2009-06-05


test.py
###############test.py######################
# -*- coding: utf-8 -*-
from matplotlib.pyplot import *
from matplotlib.ticker import *
from pylab import *

fig=figure(1)
fig.patch.set_facecolor('lightcyan')

ax=fig.add_axes([0.1, 0.1, 0.8, 0.8])
ax.patch.set_facecolor('lightpink')


x = arange(0, 10, 0.5)
y = sin(x)

lines=plot(x, y)
setp(lines, color='green',
linestyle=':',linewidth=2,marker='o',mec='blue',mew=2,mfc='red',ms=10)

for label in ax.xaxis.get_ticklabels():
label.set_color('black')
label.set_rotation(45)
label.set_fontsize(28)
for line in ax.xaxis.get_ticklines():
line.set_color('blue')
line.set_markersize(8)
line.set_markeredgewidth(2)

for label in ax.yaxis.get_ticklabels():
label.set_color('black')
label.set_rotation(45)
label.set_fontsize(28)
for line in ax.yaxis.get_ticklines():
line.set_color('blue')
line.set_markersize(8)
line.set_markeredgewidth(2)

show()
#################EOF####################
Post by pem
Thank you for your reply.
Those codes works well in matlab, shows a thin ring of 'MarkerEdgeColor'
and the marker is filled with 'MarkerFaceColor'. In fact, I am trying to
transplant
them to Octave, but find there are no counterparts in Octave to reproduce
this effect.
Continue reading on narkive:
Loading...