Document Classespstricks figure distorted in GSview

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
tsurreal
Posts: 15
Joined: Sat Aug 02, 2008 6:48 pm

pstricks figure distorted in GSview

Post by tsurreal »

Hi guys,

I use GSview to see the PS output file. But strangely it distorts some figures, at some zoom factors, that I have drawn with pstricks. Refer the attached captured images, they are from the same file but when zoomed with different factors. I generate the PDF from this PS file so as a result the image in PDF is also distorted. As I understand pdflatex does not work when there are pstricks images in the file. Any tips on what I can do?

Thanks,

tsurreal
Attachments
This is how it looks at some zoom factors
This is how it looks at some zoom factors
distorted.jpg (13.97 KiB) Viewed 3728 times
This is how it should look
This is how it should look
correct.jpg (11.08 KiB) Viewed 3728 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

pstricks figure distorted in GSview

Post by gmedina »

Hi,

could it be possible for you to attach the actual offending code? Maybe an option could be to use the pst-pdf or pdftricks packages to generate directly a PDF document including your PSTricks diagram.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
tsurreal
Posts: 15
Joined: Sat Aug 02, 2008 6:48 pm

Re: pstricks figure distorted in GSview

Post by tsurreal »

Hi, thanks for an answer. I am attaching a sample code. Try zooming in the figure with GSviewer.

- tsurreal
Attachments
pstrickstest.tex
(2.51 KiB) Downloaded 305 times
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

pstricks figure distorted in GSview

Post by gmedina »

Hi,

it seems to me that the problem was caused by some of the definitions of your diagram and not by the viewers used. I slightly modified a portion of your code to

Code: Select all

\pscustom[fillstyle=none,linecolor=gray,linewidth=0.2]
{
\pscurve[curvature=1 0.5 0]%
(4,4.29)(5,3.89)(6,3.7)(8,3.92)
} 
and everything worked as expected.

Edit: I was too hasty when I first replied. There's still some problem. With the modified code the resulting .dvi document is OK; once converted to a .ps file (DVItoPS), still there's no problem, but when I used PStoPDF to get a .pdf file, the gray stripe in your diagram appeared in the wrong position.

Hmmm. I will have to do some tests. Unfortunately, I can't do them right now, but once I have time I will try to figure out where the problem is.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
tsurreal
Posts: 15
Joined: Sat Aug 02, 2008 6:48 pm

Re: pstricks figure distorted in GSview

Post by tsurreal »

Thank you very much gmedina. I will look forward to a solution to this problem.

- tsurreal
tsurreal
Posts: 15
Joined: Sat Aug 02, 2008 6:48 pm

pstricks figure distorted in GSview

Post by tsurreal »

Ok, so I have a solution myself. It might not be totally optimized but it works! I modified the description of the black arch as follows:

Code: Select all

\pscustom[fillstyle=solid, fillcolor=Black, linewidth=0]
{
\psline(2,4)(2.25,4)
\pscurve[curvature=1 1 0]%
(2.25,4)
(6.0,3.4)
(9.75,4)
\psline(9.75,4)(10,4)
\psline(10,4)(10,4.2)
\psline(10,4.2)(9.75,4.2)
\pscurve[curvature=1 1 0]%
(9.75,4.2)
(6.0,3.6)
(2.25,4.2)
\psline(2.25,4.2)(2,4.2)
\psline(2,4.2)(2,4)
}
Cheers :D
Post Reply