Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Julian Mishke

Greenhorn
+ Follow
since Apr 04, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Julian Mishke

Hi, Is it possible to re-open a thread 'plotting String on a graph'? I resolved it prematurely.

Thank you,

J.
10 years ago
Hello Everyone,

You all have been so helpful so I'm coming back for more help, if I may.

I'm trying to plot 4 sets of data on 1 graph from a .txt file. At the moment they are being shown on separate pages and accessed by pressing a '[' key. I would like them to be displayed on 1 and the same graph with different colour representing each set/ column. I am not sure how to modify this code to enable this.

Thank you very much for all your time in advance.




The full code as follows:



And this is sample of data:


10 years ago
Thanks a lot Wouter, that was very helpful suggestion. I managed to plot the names, but now, the problem is- not all the names from the rows are being displayed- it skipped the last name. I don't understand why as all the numbers were showing on the x-axis.

Would you please let me know where I'm going wrong with this?

Thanks a lot.

10 years ago
Hi Everyone and big thank you for very warm welcome.

Thanks Mark for suggestion about definition of the method 'getString'- I added another class called 'Table' which has this method defined. It doesn't error the method now at least.

Now, going back to the original question, I am still struggling with getting my for loop working ('void drawBoroughsNames()'). I guess this bit relates to it:



I added println and it doesn't show anything, apart from new error: 'The field Component.x is not visible'. ???
Just to remind you- I'm trying to replace the numbers printed on the x-axis with the names of the places.

Thanks a lot for all your help!
10 years ago
Hi Marc,

The .txt file I'm plotting data from is called data (sample attached below).

Would it be easier for you if you saw the full code? I attached it to this post. The bit I'm struggling with is 'void drawBoroughsNames()' (line no 122-132).

I am very grateful for your help and apologies for double posting.

J.





10 years ago
Hi,


I'm trying to plot a String of names on a graph using a .tsv file, but I'm having a problem with my for loop.

I first plotted the numbers- each number refers to the city (col 0)- this is the code.




Now, I would like to replace the numbers with the names of the places (column 5) but having trouble with getting the code right. Would you please, let me know where I'm going wrong?
Thank you!




This is the data file:


10 years ago
Hi,


I'm trying to plot a String of names on a graph using a .tsv file, but I'm having a problem with my for loop.

I first plotted the numbers- each number refers to the city (col 0)- this is the code.




Now, I would like to replace the numbers with the names of the places (column 5) but having trouble with getting the code right. Would you please, let me know where I'm going wrong?
Thank you!



This is the data file:


10 years ago