Graphics, Figures & TablesInequalities in PSTricks

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Inequalities in PSTricks

Post by coachbennett1981 »

I am having some difficulty with graphing inequalities in PStricks. I am wondering if these can be done easily. I used some code from the pstricks homepage to see if I can get it to work.

1. The plot is y=2x+1 (I am trying to shade as those it is y<=2x+1). Is there a way to see the numbers on the axis more clearly?

2. Is there code to draw inequalities?

Thank you for your suggestions.


Nick

Code: Select all

\documentclass[a4paper,ngerman,12pt,parskip]{scrartcl} 
\usepackage[T1]{fontenc} 
\usepackage[utf8]{inputenc} 
\usepackage{mathpazo}
\usepackage{babel}

\usepackage{pstricks-add}

\begin{document} 

\begin{center}
\psset{unit=1cm,opacity=0.4}

\psframebox[fillstyle=solid,fillcolor=black!10,framesep=0pt]{%
\begin{pspicture}(-3.2,-3.2)(6,6)
  \psaxes{<->}(0,0)(-3,-3)(6,6)
  \pscustom[fillstyle=solid,fillcolor=blue!30,linestyle=none,algebraic]{%
    \psplot{-3}{3}{2*x+1 }
    \psline(5,0)(0,0)
    \psline(5,0)(5,-5)}
  \psplot[linewidth=2pt,algebraic]{-3}{3}{2*x+1}
\end{pspicture}}
text
\end{center}

\end{document}


Last edited by coachbennett1981 on Fri Jun 11, 2010 12:29 pm, edited 1 time in total.

Recommended reading 2024:

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

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

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Inequalities in PSTricks

Post by CrazyHorse »

coachbennett1981 wrote:I am having some difficulty with graphing inequalities in PStricks. I am wondering if these can be done easily. I used some code from the pstricks homepage to see if I can get it to work.

1. The plot is y=2x+1 (I am trying to shade as those it is y<=2x+1). Is there a way to see the numbers on the axis more clearly?

2. Is there code to draw inequalities?

Code: Select all

\documentclass[a4paper,ngerman,12pt,parskip]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathpazo}
\usepackage{babel}

\usepackage{pstricks-add}

\begin{document}

\begin{center}

\psframebox[fillstyle=solid,fillcolor=black!10,framesep=0pt]{%
\begin{pspicture*}(-3.2,-3.2)(6,6)
  \pscustom[fillstyle=solid,fillcolor=blue!20,linestyle=none,algebraic]{%
    \psplot{-3}{3}{ 2*x+1 }
    \psline(6,13)(6,-5)(-3,-5)
  }
  \psplot[linewidth=2pt,algebraic]{-3}{3}{2*x+1}
  \psaxes{<->}(0,0)(-3,-3)(5.8,5.8)[$x$,-90][$y$,0]
\end{pspicture*}}
\end{center}

\end{document}
Herbert
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: Inequalities in PSTricks

Post by coachbennett1981 »

Thank you Herbert, that's perfect :D
Post Reply