Is there an easy way to create a plot with filled markers?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there an easy way to create a plot with filled markers?

JokerOne
Hi all,

I am looking for an easy way to create a plot with filled markers.

I hope, that the following example code will clearify my point:

graphics_toolkit('gnuplot');
setenv GNUTERM windows;

% example plot
a = rand(4);
figure(1); % circles
plot(a,'o');


% same plot with filled markers --> quite complicate!
colormap_plot = get(gca(),'colororder');
figure(2)
for c1 = 1:4
        plot(a(:,c1),'o','color',colormap_plot(c1,:),'markerfacecolor',colormap_plot(c1,:));
        hold on
endfor
hold off;

figure(3) % easier way of creating figure(2) ??
plot(a,'o','filled'); % ???
% or at least anything that will get rid of the for loop, like plot(a,'o','color',colormap_plot(1:4,:),'markerfacecolor',colormap_plot(1:4,:));  % ???


Any help is appreciated!

Max

Reply | Threaded
Open this post in threaded view
|

Re: Is there an easy way to create a plot with filled markers?

Juan Pablo Carbajal-2
On Wed, Sep 24, 2014 at 9:48 AM, JokerOne
<[hidden email]> wrote:

> Hi all,
>
> I am looking for an easy way to create a plot with filled markers.
>
> I hope, that the following example code will clearify my point:
>
> graphics_toolkit('gnuplot');
> setenv GNUTERM windows;
>
> %       example plot
> a = rand(4);
> figure(1);      % circles
> plot(a,'o');
>
>
> %       same plot with filled markers --> quite complicate!
> colormap_plot   =        get(gca(),'colororder');
> figure(2)
> for c1 = 1:4
>
> plot(a(:,c1),'o','color',colormap_plot(c1,:),'markerfacecolor',colormap_plot(c1,:));
>         hold on
> endfor
> hold off;
>
> figure(3) %     easier way of creating figure(2) ??
> plot(a,'o','filled'); % ???
> % or at least anything that will get rid of the for loop, like
> plot(a,'o','color',colormap_plot(1:4,:),'markerfacecolor',colormap_plot(1:4,:));
> % ???
>
>
> Any help is appreciated!
>
> Max
>
>
>
>
>
> --
> View this message in context: http://octave.1599824.n4.nabble.com/Is-there-an-easy-way-to-create-a-plot-with-filled-markers-tp4666672.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/help-octave

x = rand (10,2);
plot(x(:,1),x(:,2),'.','markersize', 12);

or
scatter (x(:,1),x(:,2),12,"filled")

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Is there an easy way to create a plot with filled markers?

JokerOne
Yes, the '.' -option will help me. Sorry, could have find this myself.

Thanks for your help.