2

Yesterday I've posted a question because I needed to fill a space between two curves using pspicture and I appreciate the answers. This is the post: How to fill a delimited space between curves using pspicture Now I tried to use the code that helped me to fill the areas in another figures like this: New figure But if you can see, there is a kind of rectangle at the bottom of the figure and I don't want it :( and I am pretty sure that 'rectangle' is created by the line 46 of the code that which I will attach below, and that line contain this command \psframe[linecolor=colour2, fillstyle=solid, linewidth=0.02 ,linestyle=none](0.8, -1.4)(9.13, 2.928). How could I choose those points (0.8, -1.4)(9.13, 2.928) to avoid errors in this figure and other figures that I should work with? I need to fill the space in a few more figures and the second \psframe is causing me the errors. This is the code:

\documentclass[12pt]{article}
\usepackage[usenames,dvipsnames]{pstricks}
\usepackage{epsfig}
\usepackage{pst-grad}
\usepackage{pst-plot}
\usepackage{color}
\usepackage[labelfont=bf,font=small,justification=justified]{caption}
\input{tcilatex}

\begin{document}

\begin{center}
\begin{pspicture}(3.7,-3.762997)(10.56794,8.762997)

%COLORES
\definecolor{colour0}{rgb}{0.2,0.2,1.0} %Azul
\definecolor{colour1}{rgb}{1.0,0.0,0.2} %Rojo
\definecolor{colour2}{rgb}{0.8,0.8,0.8} %Gris claro (linea punteada)
\definecolor{colour3}{rgb}{0.0,0.2,1.0} %Azul
\definecolor{colour4}{rgb}{0.2,0.6,0.0} %Verde
\definecolor{bubblegum}{rgb}{0.99, 0.76, 0.8}
\definecolor{bananayellow}{rgb}{1.0, 0.88, 0.21}
%Además, se usan colores:
%MidnightBlue: Curva IC
%LimeGreen: Curva PC
%Black: Ejes
%Gray: Región de soluciones

%EJES
%Vertical:
\psline[linecolor=black, linewidth=0.03,  arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(0.810012,-1.6741458)(0.810012,9.125854)
%Horizontal
\psline[linecolor=black, linewidth=0.03, arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(0.810012,-1.6741458)(11.110012,-1.6741458)

%SOLUCION FACTIBLE
%Region de soluciones
\psclip{
    \pscustom[linestyle=none]{
        \psline(0.810012,-1.6741458)(6.7, 8.3)
        \psline(6.7, 8.3)(0.9, 8.3)
        \psbezier(0.9, 8.3)(1, 5)(5.655, -0.8)(10.5, -1.5)
        }}
\psframe[fillstyle=solid,fillcolor=colour2, opacity=0.3](0.810012,-1.6741458)(9, 8.95)
% or \psframe[fillstyle=vlines](0.810012,-1.6741458)(9,9.125854)
\endpsclip
\psframe[linecolor=colour2, fillstyle=solid,  linewidth=0.02 ,linestyle=none](0.8, -1.4)(9.13, 2.928)


%CURVAS
%Curva LLC
%Vertical
\psline[linecolor=bubblegum, linewidth=0.02, linestyle=dashed](0.835, -1.65)(0.835, 8.95)
%Horizontal
\psline[linecolor=bubblegum, linewidth=0.02, linestyle=dashed](0.84,-1.65)(10.85,-1.65)
%Curva IC
\psline[linecolor=MidnightBlue, linewidth=0.05](0.810012,-1.6741458)(6.7, 8.3)
%Curva PC
\psbezier[linecolor=LimeGreen, linewidth=0.05](0.9, 8.3)(1, 5)(5.655, -0.8)(10.5, -1.5)
%Curva Isocosto
\psline[linecolor=LimeGreen, linewidth=0.05](1.5, 4.5)(6, 1) %C*
\psline[linecolor=bananayellow, linewidth=0.05](2.5, 3.41)(6.4, 0.39)

\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](1.6, 4.42)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](1.85, 4.22)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](2.1, 4.02)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](2.35, 3.82)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](2.6, 3.62)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](2.85, 3.43)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](3.1, 3.25)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](3.35, 3.05)
%mitad
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](3.68, 2.8)%9
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](3.93, 2.6)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](4.18, 2.42)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](4.43, 2.22)

\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](4.68, 2.03)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](4.93, 1.83)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](5.18, 1.65)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](5.43, 1.46)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](5.68, 1.26)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](5.93, 1.06)
%Optimal Incentive S.
%\psline[linecolor=bubblegum, linewidth=0.05](3.21, 3.33)(0.8,5.2)


%TEXTO AGREGADO (Números, Letras, etc)
\rput[bl](0.73,-2.1076814){$\scriptstyle{0}$}
\rput[bl](10.93,-2.2076814){$w_{\scriptscriptstyle{F}}$}
\rput[bl](0.16,8.7){$w_{\scriptscriptstyle{E}}$}
\rput[bl](10.5, 8.2){$45^{\circ}$}

\rput[bl](0.16, 2.928){$w^{*}_{\scriptscriptstyle{E}}$}
\rput[bl](0.16, 1.9){$w^{t}_{\scriptscriptstyle{E}}$}

\rput[bl](3.35, -2.2076814){$w^{*}_{\scriptscriptstyle{F}}$}
\rput[bl](4.25, -2.2076814){$w^{t}_{\scriptscriptstyle{F}}$}

\rput[bl](1.1, 4.45){$\scriptstyle{C^{*}}$}

%INTERSECCIONES
%Línea 45 grados
\psline[linecolor=black, linewidth=0.0, linestyle=dashed, dash=0.18cm 0.11cm](0.81,-1.6741458)(10.5,8.02)

%Línea horizontal punteada de intersección UNO
\psline[linecolor=black, linewidth=0.0, linestyle=dashed, dash=0.18cm 0.11cm](0.810012, 1.93)(4.41, 1.93) 
%Línea vertical punteada de intersección UNO
\psline[linecolor=black, linewidth=0.0, linestyle=dashed, dash=0.18cm 0.11cm](4.41, -1.6741458)(4.41, 1.95)
%Interseccion UNO
\psdots[linecolor=black, dotsize=0.1](4.41, 1.93)

%Línea horizontal punteada de intersección DOS
\psline[linecolor=black, linewidth=0.0, linestyle=dashed, dash=0.18cm 0.11cm](0.810012, 2.928)(3.5, 2.928) 
%Línea vertical punteada de intersección DOS
\psline[linecolor=black, linewidth=0.0, linestyle=dashed, dash=0.18cm 0.11cm](3.52, -1.6741458)(3.52, 2.93)
%Interseccion DOS
\psdots[linecolor=black, dotsize=0.1](3.52, 2.928)


%LEYENDA
\psframe[linecolor=black, linewidth=0.01, fillstyle=solid, dimen=outer](16.070012,2.5)(10.110012,5.8)
%Recta mala
\psline[linecolor=bananayellow, linewidth=0.05](10.480012, 5.314146)(11.1133455, 5.314146)%1
%PC (binding)
\psline[linecolor=LimeGreen, linewidth=0.05](10.480012,4.85)(11.1133455,4.85)%2
%IC (binding)
\psline[linecolor=MidnightBlue, linewidth=0.05](10.480012,4.395854)(11.1133455,4.395854)%3
%LLC (binding)
\psline[linecolor=bubblegum, linewidth=0.05, linestyle=dashed, dash=0.13638889cm 0.10583334cm](10.480012,3.88)(11.1133455,3.88)%4
%Isocost %5
\psline[linecolor=LimeGreen, linewidth=0.05, 0.10583334cm](10.480012,3.45)(11.1133455,3.45)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](10.52, 3.45)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](10.80, 3.45)
\psdots[linecolor=black,fillcolor=white, dotstyle=o, dotsize=0.15](11.08, 3.45)
%Region solutions
\pspolygon[linecolor=gray, linewidth=0.02, fillstyle=solid,fillcolor=colour2, opacity=0.3](10.4, 2.85)(11.25, 2.85)(11.25, 3.05)(10.4, 3.05)%6

%Texto
\rput[bl](11.4733574, 5.2191875){\footnotesize : Tangent Solution}%2
\rput[bl](11.4733574, 4.7191875){\footnotesize : PC (binding)}%2
\rput[bl](11.4733574, 4.2191876){\footnotesize : IC (binding)}%3
\rput[bl](11.4733574, 3.7191876){\footnotesize : LLC Manager (binding)}%4
\rput[bl](11.4733574, 3.27){\footnotesize : Isocost representing $C^{*}$}%5
\rput[bl](11.4733574, 2.8){\footnotesize : Region of feasible solutions}%6

\end{pspicture}
\end{center}

{\footnotesize \textbf{Figure 10.} Linear incentives with logarithmic utility function. }

\end{document}

I will appreciate any comments to learn and a possible solution for this case and recommendations for the other ones, thanks :)

  • Is the yellow line (with the label "Tangent Solution") supposed to be tangent to the green line (PC Binding) ? – Thruston Mar 31 at 9:54
3

The following code works:

...
%Black: Ejes
%Gray: Región de soluciones

%EJES
%Vertical:
%SOLUCION FACTIBLE
%Region de soluciones
\psclip{
    \pscustom[linestyle=none]{
        \psline(0.810012,-1.6741458)(6.7, 8.3)
        \psline(6.7, 8.3)(0.9, 8.3)
        \psbezier(0.9, 8.3)(1, 5)(5.655, -0.8)(10.5, -1.5)
        }}
\psframe[fillstyle=solid,fillcolor=colour2, opacity=0.3](0.810012,-1.6741458)(9, 8.95)
% or \psframe[fillstyle=vlines](0.810012,-1.6741458)(9,9.125854)
\endpsclip
\psframe[fillstyle=solid, fillcolor=white, linestyle=none](0.8,-1.8)(9.13, 2.928)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\psline[linecolor=black, linewidth=0.03,  arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(0.810012,-1.6741458)(0.810012,9.125854)
%Horizontal
\psline[linecolor=black, linewidth=0.03, arrowsize=0.05291666666666667cm 2.0,arrowlength=1.4,arrowinset=0.0]{->}(0.810012,-1.6741458)(11.110012,-1.6741458)
%CURVAS
%Curva LLC
%Vertical
%\psline[linecolor=bubblegum, linewidth=0.02, linestyle=dashed](0.835, -1.65)(0.835, 8.95)
%Horizontal
%\psline[linecolor=bubblegum, linewidth=0.02, linestyle=dashed](0.84,-1.65)(10.85,-1.65)

...

%Isocost %5
\psline[linecolor=LimeGreen, linewidth=0.05](10.480012,3.45)(11.1133455,3.45)

enter image description here

In the future, I suggest you should learn Asymptote !!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.