X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08 Jun 2015 05:29 AM by  anon
OVERPLOT with MIN_VALUE resetting the Y range of the PLOT
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:32
New Member


--
08 Jun 2015 05:29 AM
    If I do following in IDL: a = findgen(10)*0.01+0.3 b = findgen(10)*0.01+0.2 plot(a) plot(b, /overplot) The output is nicely displayed, however, if I do plot(b, min_value=0.3, /overplot) Then the Y range will be reset to default which is [0,1], then the curve become flattened and the plot full of space, looks ugly. Is there anything I can do to resolve this? I mean preserve the plot ratio and size even the overplot data is given below the min_value. Thanks for any help and hint. Regards, Sullivan

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    08 Jun 2015 12:52 PM
    Hi Sullivan, One thing about the new function graphics in IDL is that there it a lot of automation with re-scaling your graphs. If the data in your data space changes, then IDL automatically re-scales the graph to fit the data. You can avoid this by specifying the range parameters like XRANGE AND YRANGE. Here is an example code which you can step through to see how min_value works compared to YRANGE. Save this as a .pro file called overplot_example_honor.pro and then run the program. There are some lines which will stop the execution so that you can step through and see the changes that each plot make. Hope this helps! pro overplot_example_honor ireset, /no_prompt a = findgen(10)*0.01+0.3 b = findgen(10)*0.01+0.2 c = findgen(10)*0.01+0.25 p1 = plot(a, color = 'red', yrange = [min([a,b]), max([a,b])]) p2 = plot(b, color = 'blue',/overplot) stop p3 = plot(c, color = 'green',/overplot) stop p3.min_value=.3 end

    Deleted User



    New Member


    Posts:32
    New Member


    --
    08 Jun 2015 10:47 PM
    Hi Zach, Thanks for your prompt reply. Your sample code works well and helps a lot. Thanks much. Regards, Sullivan
    You are not authorized to post a reply.