octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Plot problem?


From: Robert T. Short
Subject: Plot problem?
Date: Tue, 16 Jun 2009 13:32:43 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16

And on that note.....

This may be a gnuplot problem. I don't know. I am running 4.2 (the current debian lenny gnuplot package). I confess to being somewhat overwhelmed by the plot/graphics threads so this may have already been addressed. If so, I apologize in advance.

The attached script is a vastly simplified version of something I do a lot of. It draws circles with lines between them.

I frequently print to encapsulated PostScript or fig, depending on whether I further need to annotate the plot or not.

There are two problems: 'axis square' doesn't seem to work and line styles don't print correctly.

--- With either 'axis square' or 'axis equal', the axes come out unequal so the circles are smashed.

On my desktop with a standard monitor (1280x1024) the axes are ALMOST square. On my laptop (wider in the x direction) the circles are visibly flatter.

The fig file comes out just exactly like the monitor display. However, if I resize before printing so the axes appear square on the screen, the plot is redrawn & printed so the fig file still comes out flattened.

The eps file comes out with square axes.


--- The on-screen plot comes out with the line styles and colors specified. The fig file cycles through the colors for both the circles and the lines. The eps file gets the colors right, but not the line styles.


I could do this to a fig file in 2.9 by resizing then printing...


In MATLAB, I can't do fig files of course, but it gets the eps file right EXCEPT it loses all the colors....

Any suggestions?

Bob
--
Robert T. Short, Ph.D.
PhaseLocked Systems

centers = {[-2 -2] [-2 0] [-2 2] [0 -2] [0 0] [0 2] [2 -2] [2 0] [2 2] };
line    = [-2.5 2.5];

arg = linspace(-pi,pi,100);
radius = 0.25;

x = radius*cos(arg);
y = radius*sin(arg);

h1 = figure(1)
clf;
hold on;

for idx=1:length(centers)
  c = centers{idx};
  plot(x+c(1),y+c(2),'-g')
end

plot([-2.5 +2.5],[-1.0 -1.0],'-k');
plot([-2.5 +2.5],[+1.0 +1.0],'-k');
plot([-1.0 -1.0],[-2.5 +2.5],'-k');
plot([+1.0 +1.0],[-2.5 +2.5],'-k');


%axis('square')
axis('equal');
axis([-3 +3 -3 +3]);
hold off

fprintf(1,'Resize if desired, then press enter\n')
pause
%print -dfig XXX.fig
print -deps XXX.eps

reply via email to

[Prev in Thread] Current Thread [Next in Thread]