Plotlib 3, svn version, looking for contributors !
Stéphane Mottelet
stephane.mottelet at utc.fr
Thu Jul 2 17:27:28 CEST 2009
Hi all,
11 days ago Richard Owlett was looking for something which was in fact
the "ColorOrder" axes property for Scilab. Since that day I have been
working hard and I am proud to annouce that the next version of the
plotlib implements many Matlab properties. With the plotlib, you
can now issue commands like :
_set(gca(),'linestyleorder',[1 0 0;1 0 0]);
t=linspace(0,2*%pi,100);
plot(t,sin((1:10)'*t))
The new command "_set" extends "set" to new properties, which are
hidden in the user_data field of graphics entities.
1-Available highlevel commands of the plotlib :
"plot", "semilogx", "semilogy", "loglog", "mesh","surf","surfl",
"pcolor", "plot3", "quiver", "quiver3", "triplot", "tripcolor"
"trimesh", "trisurf", "trisurfl", "fill", "fill3","axis","caxis",
"grid","shading","view","hidden","_set"
quiver3 and quiver are new. The commands axis, caxis, view, shading,
grid where previously supported as property/value pairs in a non-standard
way (with respect to Matlab) :
Plotlib < 0.3 :
plot(1:10,sin(1:10),'axis','equal')
Plotlib >=0.3 :
plot(1:10,sin(1:10))
axis equal
got it ?
The new version of the caxis command behaves like in Matlab. Changing
the CLim property automatically updates the colors in a shaded plot :
pcolor(rand(10,10)
shading interp
caxis([0 0.5])
typing "caxis auto" restores the automatic scaling. If you don't like the
way plots flicker each time you modify a property, use the drawlater/drawnow
commands (original Scilab comands)
drawlater
pcolor(rand(10,10))
shading interp
caxis([0 0.5])
colorbar
drawnow
2-properties for "leaf" entities
'XData', 'YData', 'ZData', 'CData', 'UData','VData','WData','VertexNormals'
'Color','FaceColor','EdgeColor','BackFaceLighting','LineWidth','LineStyle'
'Marker','MarkerSize','MarkerEdgeColor', 'MarkerFaceColor'
Most of these properties can be specified at entity creation time, e.g.
plot(t,sin(t),'o','markerfacecolor',[1,0,0],'LineWidth',2)
but for the moment XData, YData, ZData, UData, VData, WData can
be modified only by using _set. As far as I am concerned, I will use this for
animations in XMLlab :
[x,y]=meshgrid(-1:0.1:1);
h=surf(x,y,cos(x.*x+y.*y));
shading interp
_set(h,'cdata',rand(x));
3-properties for "axes" entities
'XColor','YColor','ZColor','Color'
'XTick','YTick','ZTick'
'XTickLabel','YTickLabel','ZTickLabel'
'XLabel','YLabel','ZLabel','Title','XGrid','YGrid','ZGrid'
'XGridColor','YGridColor','ZGridColor','PlotBoxAspectRatio'
'CLim','XLim','YLim','ZLim'
'CLimMode','XLimMode','YLimMode','ZLimMode'
'XScale','YScale','ZScale'
'ColorOrder','LineStyleOrder'
'Visible','XAxisLocation','YAxisLocation','Light'
'Box','View'
All these properties are used by using "_set" :
plot(1:10,sin(1:10));
_set(gca(),'xtick',[1 5 10],'xticklabel',['one','five','ten']);
4-funny things : if you make subplots
[x,y]=meshgrid(-1:0.1:1);
subplot 221; pcolor(x.*x-y.*y); colorbar
subplot 222; surfl(x.*x-y.*y);
subplot 223; quiver(x,y,-y,x);
subplot 224; surf(x.*x+y.*y); grid
then you can double-click within an axes box to zoom back and
forth a given plot.
You can download the new plotlib at the following urls :
http://www.lmac.utc.fr/~mottelet/plotlib/plotlib0.3.tgz
http://www.lmac.utc.fr/~mottelet/plotlib/plotlib0.3.zip
Comments are welcome. If someone wants to contribute, this is
now easy to add a missing property.
Enjoy !
S.
--
Stéphane Mottelet
Laboratoire de Mathématiques Appliquées
Université de Technologie de Compiègne
http://www.lmac.utc.fr/~mottelet
More information about the users
mailing list