X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 04 Nov 2010 04:28 PM by  anon
New Barplot tickmark bug
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
04 Nov 2010 04:28 PM
    I found a barplot tickmark bug that could be easily reproduced. Here's my situation. I have two sets of values, and I made a custom tickmark (xticks). If I plot only 1 bar, the tickmarks will display correctly. But when I overplot a second bar, it will mess up the tickmarks. I tried several overplot options (e.g. overplot = b1, /current, etc.), none of them seem to fix the issue. This bug seems to be related to barplot because when I overplot a line over the barplot, it also mess up the custom tickmarks. Here's my sample code. bar1=[32, 79, 85, 69,112, 99, 93, 0, 18, 10, 0] bar2=[37,111,131,114,166,148,129, 0, 46, 20, 0] xvals=indgen(11) xticks=[' ','17','18','19','20','21','22','23','0','1','2','3',' '] ;Bar1 b1=barplot(xvals,bar1,fill_color='red',xtickname=xticks) ;Bar2, if plotted, will NOT correctly displayed the tickmarks b2=barplot(xvals,bar2,bottom_values=bar1,fill_color='green',/overplot) The result plot looks like this, notice the xtickmarks are wrong compared to what I specified in xticks.

    Deleted User



    New Member


    Posts:
    New Member


    --
    10 Nov 2010 09:04 AM
    I can see what you mean. I will file a bug report on the issue. In the mean time, try this to work around the problem: 1. Grab somewhere in the plot and "wiggle" it a little, panning the plot in any direction. 2. Click the button that has the 4 arrows pointing outward to reset the plot. This seems to correct the problem. I was able to do this with IDL 8.0.1 -Josh ITTVIS

    Deleted User



    New Member


    Posts:
    New Member


    --
    18 Nov 2010 12:29 PM
    This problem seems rather random, I was plotting multiple data sets and most of them would show the correct custom tickmarks, except one set with longer data record. I extracted the values and simplied the codes as below: Notice the two empty string in xticks I added for the first and last value, this is so that all bars will be plotted inside the figure without being cut off. bar1=[44,2,10,8,67,21,55,77,9,6,48,95,18,93,55,63,115,124,31,11,6,0] xvals=indgen(n_elements(bar1)) xticks=[' ',' 3',' 4',' 5',' 6',' 7',' 8',' 9','10','11','12','13',$ '14','15','16','17','18','19','20','21','22','23',' 0',' '] b1=barplot(xvals,bar1,fill_color='red',xtickname=xticks) I tried the "wiggle" method you suggested and the redrawing didn't fix the issue. Plus since I'm plotting multiple data sources and save the plot directly to a file, this mannual "fixing" method won't really work for me. I appreaciate you reporting this bug, and please give me update when it is resolved. Thank you! FYI, I'm running 8.0.1 in Fedora 13 64-bit.
    You are not authorized to post a reply.