3

As per answer received in previous post, i'm able to draw graph mentioned below using tex file :

\documentclass[11pt,a4paper]{article}
\addtolength{\textheight}{1.1cm}
\addtolength{\textwidth}{1.1cm}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-5,-5)(5,5)%             user coordinates (is cm by default)
\psaxes[labels=none,axesstyle=polar,ticklinestyle=dashed,tickcolor=black!40](0,0)(-4,-4)(4,4)
\psaxes(0,0)(-4,-4)(4,4)%                  for the labels
\psset{fillstyle=solid,opacity=0.5}
\pswedge[fillcolor=green]{2.2}{120}{150}%  radius;startAngle;endAngle
\pswedge[fillcolor=yellow]{1.5}{150}{180}
\pswedge[fillcolor=red]{1.25}{180}{210}
\pswedge[fillcolor=red]{1.8}{210}{240}
\pswedge[fillcolor=green!100!white!80]{1.5}{240}{270}
\pswedge[fillcolor=orange]{2.4}{270}{300}
\pswedge[fillcolor=magenta]{2.2}{300}{330}
\pswedge[fillcolor=cyan]{0.6}{330}{360}
\pswedge[fillcolor=green](4.25;90){0.5}{70}{110} \rput(4.9;90){One}
\pswedge[fillcolor=yellow](4.25;80){0.5}{70}{110}\rput(4.9;80){Two}
\pswedge[fillcolor=red](4.25;70){0.5}{70}{110}   \rput(4.9;70){Three}
\pswedge[fillcolor=blue](4.25;60){0.5}{70}{110}  \rput[b](4.9;60){four}
\psset{opacity=1}
\end{pspicture}
\end{document}

enter image description here

Can you please suggest, how can i change LABEL values on AXIS from 1, 2, 3, 4 to 25,50,75 and 100

6

You can change the second psaxes to

 \psaxes[dx=1,dy=1,Dx=25,Dy=25](0,0)(-4,-4)(4,4)% 

Note that dx and dy change the value of the tickmarks, and Dx and Dy change the tickmarks themselves; have a look at the pst-plot documentation for further details.

screenshot

% arara: latex
% arara: dvips
% arara: ps2pdf
% !arara: indent: {overwrite: true, trace: on}
\documentclass{standalone}

\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-5,-5)(5,5)%             user coordinates (is cm by default)
    \psaxes[labels=none,axesstyle=polar,ticklinestyle=dashed,tickcolor=black!40](0,0)(-4,-4)(4,4)
    \psaxes[dx=1,dy=1,Dx=25,Dy=25](0,0)(-4,-4)(4,4)%                  for the labels
    \psset{fillstyle=solid,opacity=0.5}
    \pswedge[fillcolor=green]{2.2}{120}{150}%  radius;startAngle;endAngle
    \pswedge[fillcolor=yellow]{1.5}{150}{180}
    \pswedge[fillcolor=red]{1.25}{180}{210}
    \pswedge[fillcolor=red]{1.8}{210}{240}
    \pswedge[fillcolor=green!100!white!80]{1.5}{240}{270}
    \pswedge[fillcolor=orange]{2.4}{270}{300}
    \pswedge[fillcolor=magenta]{2.2}{300}{330}
    \pswedge[fillcolor=cyan]{0.6}{330}{360}
    \pswedge[fillcolor=green](4.25;90){0.5}{70}{110} \rput(4.9;90){One}
    \pswedge[fillcolor=yellow](4.25;80){0.5}{70}{110}\rput(4.9;80){Two}
    \pswedge[fillcolor=red](4.25;70){0.5}{70}{110}   \rput(4.9;70){Three}
    \pswedge[fillcolor=blue](4.25;60){0.5}{70}{110}  \rput[b](4.9;60){four}
    \psset{opacity=1}
\end{pspicture}
\end{document}

Following the comments, if you only want positive numbers on the axis ticks then you can use

\psaxes[dx=1,dy=1,Dx=25,Dy=25](0,0)(0,0)(4,4)
\psxTick{0}(-1){25}
\psxTick{0}(-2){50}
\psxTick{0}(-3){75}
\psxTick{0}(-4){100}
\psyTick{0}(-1){25}
\psyTick{0}(-2){50}
\psyTick{0}(-3){75}
\psyTick{0}(-4){100}

I imagine that this could be wrapped in a multido statement...

screenshot2

10
  • This is slightly unrelated but do you know why when I try to typeset this, I can't see the graph but only the labels (the numbers)?
    – Alenanno
    Oct 26 '13 at 15:35
  • @Alenanno did you copy and paste my code? it produces the output I gave in my screenshot
    – cmhughes
    Oct 26 '13 at 15:36
  • Yes, that's what I did. The same happens with the code from the OP... At first I had errors, then I updated my packages and that fixed the errors but I only see this (link) right now. :/
    – Alenanno
    Oct 26 '13 at 15:38
  • I do have pasted the complete code, that's the weird part. lol :P
    – Alenanno
    Oct 26 '13 at 16:01
  • 1
    @PawanMude see the update
    – cmhughes
    Oct 26 '13 at 17:47

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.